w3c / webmediaporting

Web Media porting spec
2 stars 10 forks source link

timing of generating the "ended" event #24

Open jpiesing opened 7 years ago

jpiesing commented 7 years ago

HTML5 defines the "ended" event as follows ( https://www.w3.org/TR/html51/semantics-embedded-content.html#eventdef-media-ended )

Playback has stopped because the end of the media resource was reached.

HTML5 includes no timing requirements on when this event is generated.

This is being interpreted as meaning that the all the video and/or audio of the media resource have been output by the device. However some media devices apparently have delays between the last video/audio being visible/audible and this event generated greater than one second.

The timing of this event is particularly problematic for client-side ad insertion. Ads need to be played to the end and this event is the obvious way of detecting that. Sure there's also the ended attribute but if this delay occurs with the event then why would it not occur with the attribute too?

The definition of the ended attribute relies on the definition of the current playback position (see https://html.spec.whatwg.org/multipage/media.html#playing-the-media-resource:media-element-6 ) which is itself an integration issue - see https://github.com/w3c/webmediaporting/issues/9 .

jpiesing commented 7 years ago

See https://github.com/whatwg/html/issues/3041