Join the AMA (Ask Me Anything) with the Firefox leadership team to celebrate Firefox 20th anniversary and discuss Firefox’s future on Mozilla Connect. Mark your calendar on Thursday, November 14, 18:00 - 20:00 UTC!

Този сайт ще има ограничена функционалност, докато се извършва тече неговата поддръжка. Ако дадена статия не може реши проблема ви и искате да зададете въпрос, нашата общност е готова да ви помогне на @firefox в Twitter и /r/firefox в Reddit.

Търсене в помощните статии

Избягвайте измамите при поддръжката. Никога няма да ви помолим да се обадите или изпратите SMS на телефонен номер или да споделите лична информация. Моля, докладвайте подозрителна активност на "Докладване за злоупотреба".

Научете повече

HTML5 video played attribute not updating

  • 1 отговор
  • 1 има този проблем
  • 2 изгледи
  • Последен отговор от sebworld

more options

I've been experimenting with HTML5 video tag in javascript.

I'm currently trying to develop a script that checks if a user has fully watched a video, without skipping any content.

I'm doing this by interrogating the videoElement.played attribute.

If the user starts the video and skips to the end, for example. The script I have developed will detect that the .played attribute is made up of dis-continuous TimeRanges. If the video is then re-played, however, the played attribute stops getting updated further.

I have prepared a jsFiddle to demonstrate this:

http://jsfiddle.net/rNudr/6/

Google Chrome, however, does appear to work as expected on the subsequent playback updating this attribute - so I believe this to be a bug in Firefox.

I've been experimenting with HTML5 video tag in javascript. I'm currently trying to develop a script that checks if a user has fully watched a video, without skipping any content. I'm doing this by interrogating the videoElement.played attribute. If the user starts the video and skips to the end, for example. The script I have developed will detect that the .played attribute is made up of dis-continuous TimeRanges. If the video is then re-played, however, the played attribute stops getting updated further. I have prepared a jsFiddle to demonstrate this: http://jsfiddle.net/rNudr/6/ Google Chrome, however, does appear to work as expected on the subsequent playback updating this attribute - so I believe this to be a bug in Firefox.

Всички отговори (1)

more options

RE: The jsFiddle Worth mentioning, you need to click the "check if fully watched" button and it will output the whole seconds of the video that has been watched so far as a series of 0s and 1s. (0=not watched this second of video, 1=watched this second of the video)