Popcorn changing source

I'm trying to make one instance of a popcorn player that I can pass around to different parts of the page. My goal is to change the source of the videos but maintain the same triggers bound to the video element.

I've created a fiddle demonstrating the situation, on 'ended' I change the src in the source tag. Then, I trigger the video to play again, but instead of it playing the new video in the updated source, it plays the previos video.

Answers


Use the load method before playing again.

$($('video').children()[0]).attr('src','http://www.808.dk/pics/video/gizmo.mp4');
$pop.load();
$pop.play();

You can see it working here


Need Your Help

R LDAvis defining documents for each topic

r text-mining lda topic-modeling

This is a question about LDA and the application LDAvis in R. As this is my first time using this package I would appreciate any help that could help my research.

How to set a Negative Value to an Input box in php

php javascript

<input type="number" class="addme" value="'.$_REQUEST['pbill'].'" name="amount" min="0" required="required" placeholder="Enter amount of Pending Bills" title="Enter amount of Pending Bills"

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.