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
391 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 25

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
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
LVL 25

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
 

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 25

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 25

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 Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Filktering Alphabetically 8 28
Html value of radio 14 27
asp.net open new page without popup blocker 8 18
2 separate CSS animations 2 16
Introduction Got endorsements from your clients?  Great!  There is almost nothing better than word-of-mouth advertising.  But how can you do that on the internet?  Sure you can make a page for endorsement quotations and list them all, but who is …
PROBLEM: The other day I was working on adding an ajax request to a webpage that already had a dialog box on the page.  The dialog box was using relative positioning to be positioned next to a form field I had on the page.  Everything was working…
The viewer will learn how to dynamically set the form action using jQuery.
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)

809 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