#235 ✓ checked-in
Scott Downe

video.duration() is not reliable

Reported by Scott Downe | December 17th, 2010 @ 05:17 PM | in 0.4

Not having the proper duration will completely break popcorn. No matter the smallest chance, if we don't have that, we cannot pad the end of the tracks array, thus we will break.

I propose this solution:

( isNaN( video.duration ) ? Number.MAX_VALUE : video.duration + 1 )

if the video will never have duration, it will return NaN, if so, we set it to the max number.

Another solution is to check if the video's current position is greater than the recorded duration, and if so, update the recorded duration.

But it is clear using duration alone is not going to work.

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Popcorn.js is an HTML5 video framework that lets you bring elements of the web into your videos.

Popcorn.js is a project of Web Made Movies, Mozilla's Open Video Lab.

Shared Ticket Bins


Referenced by