Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Hello question abut HTML/CSS/Javascipt coding WordPress

  • SOLVED

Hello,
I am making a page that I am limited to Javascipt, CSS, and HTML, is their anyway to make a dynamic object in which I can call different Youtube videos on the embed to change if you click on a link?


So for example:

[Youtube Embed Object] ->Links to different videos

When links are clicked the embed changes to that video.

The limitations are as follows:

I cannot:
Calls remote scripts and pages automatically, such as JavaScript "includes" or "iframes."
Changes registry entries or otherwise writes to another person's computer hard drive.
Creates automatic pop-ups except for links that open in a new window when clicked on.
Is used to drop or read a cookie on any eBay page.
Loads any binary program on another person's computer automatically, except for Flash content.
Overwrites any area in the listing outside of the item description area.
Manipulates areas outside the listing description, including changing fonts, colors, and backgrounds in areas such as eBay headers and footers.
Posts to scripts on eBay automatically.
Redirects the user from eBay to another web page, such as using the "replace" script.

Thank you,

Answers (2)

2012-10-21

jazbek answers:

Hi Liv,

It sounds like the easiest solution for you would be to create a playlist on youtube, and then you can embed the whole playlist into your page. Then people can switch between the videos using the thumbnails inside the youtube player. Here is a site that describes how to do it:

http://www.labnol.org/internet/embed-youtube-playlists/17687/


liv comments:

I am trying this method, but the window is not showing up in preview mode.


liv comments:

I already have a playlist of the aforementioned videos.


liv comments:

I when I share a playlist it gives me only a iframe embed option, and when I try the object method the window is empty.


jazbek comments:

Are you using a wordpress site?


liv comments:

It is for an ebay listing which has very tight coding requirements.


liv comments:

Embedding a video using the <object> embed seems to work just fine, not sure why the <object> method is not working for the playlist.


jazbek comments:

If you can send a link to the playlist, I can post the embed code for you, to make sure it's correct. If it doesn't work, ebay might not allow embeds of playlists.


jazbek comments:

It seems like the embed code format for youtube playlists has changed. I need to go offline for a few hours, but I will do some research and get back to you.


liv comments:

OK thank you.


jazbek comments:

Hi Liv,

I figured it out -- you just need to remove the "PL" from the beginning of the ID, not the underscore as well. This code worked for me:

<object width="480" height="385">
<param name="movie" value="http://www.youtube.com/p/_411laEMx3JX-DmLVgg-RM941EwSBpxY?version=3&amp;autoplay=0&amp;autohide=0">
</param><param name="allowFullScreen" value="true"></param>
<param name="allowscriptaccess" value="always"></param>
<embed src="http://www.youtube.com/p/_411laEMx3JX-DmLVgg-RM941EwSBpxY?version=3&amp;autoplay=0&amp;autohide=0" type="application/x-shockwave-flash" width="480" height="385" allowscriptaccess="always" allowfullscreen="true">
</embed>
</object>​


liv comments:

That worked thank you, it is very strange how you have to add the underscore.
Thanks again.

2012-10-21

Christianto answers:

Hi Liv,

Can you use jQuery plugin on your page?
There is [[LINK href="http://www.tikku.com/jquery-youtube-tubeplayer-plugin"]]jQuery tubeplayer plugin [[/LINK]] that has method to not only dynamically play YouTube url video, but other thing such as pause, stop etc

for changing the video on player this is the method
jQuery('#player').tubeplayer('play', 'YtiFjPVZKHI');
where YtiFjPVZKHI' is the video id on youTube url;

you can visit the plugin homepage and see the demo.

hope this help


liv comments:

Not sure if this would work, it might be violating the requirement:
"Calls remote scripts and pages automatically, such as JavaScript "includes" or "iframes.""


liv comments:

Yes I just tried, it gave me an error:

Description - Your listing cannot contain javascript (".cookie", "cookie(", "replace(", IFRAME, META, or includes), cookies or base href.