tim-peterson / videojs-playlist

A plugin to play multiple audio tracks or multiple videos.
Other
71 stars 49 forks source link

youtube #1

Closed da1nonly closed 11 years ago

da1nonly commented 11 years ago

hi, thanks for a great plugin just wounding would it possible to integrate videojs playlist plugin with https://github.com/eXon/videojs-youtube the plugin has been updated to support videojs 4.1.0. the videojs-youtube supports youtube playlists but the only problem is that it does not display clickable images to allow users to jump to a certain video in the playlist, but if the script was merged with your playlist script that would be really good (i not know js =( ).

also if these feature was implemented it would be a bonus like the link below. load different playlists. add and remove media file. http://tympanus.net/codrops/2010/07/26/music-portfolio-template/

again thanks for a good plugin.

tim-peterson commented 11 years ago

It is relatively straightforward to get the url for a youtube video's thumbnail image using the video's ID. See this Stackoverflow link (http://stackoverflow.com/questions/2068344/how-to-get-thumbnail-of-youtube-video-link-using-youtube-api)[http://stackoverflow.com/questions/2068344/how-to-get-thumbnail-of-youtube-video-link-using-youtube-api]

So for videojs-playlist, put that youtube url as the vjs-track data-src=" " source and the video's ID as part of the thumbnail image's src=" " source, for example:

For video: http://www.youtube.com/watch?v=xjS6SftYQaQ the ID is: xjS6SftYQaQ

 <li>
   <a class='vjs-track' href='#episode-1' data-index='1' data-src='http://www.youtube.com/watch?v=xjS6SftYQaQ'>
   <img src="http://img.youtube.com/vi/xjS6SftYQaQ/0.jpg" >Guy stretching his leg</a>
</li> 

_Note_ you can almost use videojs-playlist.js right away without knowing Javascript except unfortunately it hadn't been set up to accept youtube urls.

Please see this gist for a modified videojs-playlist.js that alllows youtube url's as source: https://gist.github.com/tim-peterson/5958969 The differences start on line 61 where the src is set based on the tech.

if(player.techName=='youtube')
tim-peterson commented 11 years ago

Hi @da1nonly, I just updated the repository with the gist above so it now accepts youtube video's as source. Please checkout it out now. thanks for the suggestion!

da1nonly commented 11 years ago

On 9 July 2013 17:58, tim peterson notifications@github.com wrote:

thanks for the su

just wondering can you show me a working example of the player using a youtube video, also is it possible to load videos via json, thanks

tim-peterson commented 11 years ago

your jsfiddle has no javascript in it, you will have to learn some javascript first

da1nonly commented 11 years ago

hi thanks for your email, i can not figure out how to use jsfiddle properly that i the reason it was not loading on the site but on my pc i have got it to work using your example it just the youtube video i can not seem to make it work it tries to play but its a blank screen. i am not advanced in js but i have a basic knowledge on how to use it. if i see a working example i can figure out why my code was not working.

On 16 July 2013 11:26, tim peterson notifications@github.com wrote:

your jsfiddle has no javascript in it, you will have to learn some javascript first

— Reply to this email directly or view it on GitHubhttps://github.com/tim-peterson/videojs-playlist/issues/1#issuecomment-21033353 .