johndyer/mediaelement — Issue #310: seek bar/video length broken when video length is detected as Infinity.
Author: gonchuki
Created: 2011-11-22 01:59:53+00:00
State: open

This is happening on our server as (I presume) video data is being streamed from the server so the interface shows `NaN:NaN` as the file duration, and the seekbar is of no use as all points of the bar show a tooltip with another pair of NaNs (inspecting the `` tag in Firefox shows the duration as Infinity, so that part is not a bug on your library)

On our current implementation I added these lines of code inside the `loadedmetadata` event:

if (media.duration === Infinity) {
player.controls.find('.mejs-time-rail, .mejs-duration-container').addClass('invisible');
}

where `invisible` just adds `visibility: hidden;`

Now, I'm not sure if my patch is good enough as we are not using many of the features of mejs, maybe having a video with Infinity length creates other side effects that I'm not aware of.