Solved

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

Posted on 2013-12-21
9
377 Views
Last Modified: 2013-12-27
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!
0
Comment
Question by:brihol44
  • 4
  • 4
9 Comments
 
LVL 23

Expert Comment

by:Roopesh Reddy
ID: 39734644
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
 
LVL 24

Expert Comment

by:dgrafx
ID: 39734663
basically
listen for the 'ended' event of the currently playing video
then load new video
then play()
0
 

Author Comment

by:brihol44
ID: 39734699
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
 
LVL 24

Expert Comment

by:dgrafx
ID: 39734712
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:brihol44
ID: 39734800
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
 
LVL 24

Expert Comment

by:dgrafx
ID: 39734922
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
 

Accepted Solution

by:
brihol44 earned 0 total points
ID: 39735252
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
 
LVL 24

Assisted Solution

by:dgrafx
dgrafx earned 250 total points
ID: 39735253
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
 

Author Closing Comment

by:brihol44
ID: 39741500
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

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now