Creating simple video playlist player but can't seem to be able to continue to click on images to play.

So I'm getting the videos to load the first time but I can't seem to keep on playing videos. It will play one when you click on any playlist item but after that it won't load a new one.

http://jsfiddle.net/7bwZS/

Thanks for the help!
brihol44Asked:
Who is Participating?
 
brihol44Author Commented:
So why wouldn't what I figured out here work. It's exactly what I need but maybe I miss-communicated things. Sorry if I did.

http://jsfiddle.net/uY8Y8/
0
 
Roopesh ReddyIT AnalystCommented:
Hi,

Check this tutorial on building a HTML 5 Video player with playlist - http://www.creativebloq.com/html5/build-custom-html5-video-player-9134473

Hope it helps u...
0
 
dgrafxCommented:
basically
listen for the 'ended' event of the currently playing video
then load new video
then play()
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
brihol44Author Commented:
Ok, well I'm not sure what you mean. Can you add onto my existing code js fiddle? I don't want to start from scratch but just use my existing code.
0
 
dgrafxCommented:
Now I see you are wanting to build a YouTube player ...

Here is a link - you should work through it - it is very good and provides all you need and more to build an awesome video player.

http://tutorialzine.com/2010/07/youtube-api-custom-player-jquery-css/

my advice is to start from scratch - sorry ...
0
 
brihol44Author Commented:
Ok, well no disrespect but I found 100 other articles like that by searching google before I asked for help. I'm hoping for a coded solution from what I already coded. The example you sent is over-bloated for what I need. I believe I only need the event listener part at this time. I learn best by coding my own and expanding off it.
0
 
dgrafxCommented:
No disrespect to you either - but I actually knew that.
And my point (without wanting to be rude) is that what you have so far is not really too great - if you can see what I mean.

I gave you the event listener but you said you didn't know what I meant.
Then when I looked at your code I didn't see any clue on where to hook in listeners.
So I suggested starting from scratch using an example that has listeners galore!

media.addEventListener(events[ii], function(e) {
      if(e.type == 'ended') {
            $(id_of_an_element).click();
            /*            
            when this element is clicked the proper video is loaded and starts playing
            so we call the elements click event when the current video has ended
            */
      }
});

good luck ...
0
 
dgrafxCommented:
maybe I miscommunicated - I said that I don't see where I could hook in an event listener - so that isn't of any help to I guess - sorry ...

just try what I posted - editing a bit to fit your scenario of course - that is if you can find code that is exposed enough to hook it in ...

or you could start from scratch with the example I posted ...
0
 
brihol44Author Commented:
The other advice is good but I don't want to follow other examples that I can find just as easy on Google. I want to learn the hard way that my way sucks or fits what I need perfectly but at least I'm learning on my own than following a tutorial. I don't need experts-exchange for that.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.