Closed Bug 1238862 Opened 9 years ago Closed 9 years ago

[TV][Seamless experience] The total length of video should not be 00:00

Categories

(Firefox OS Graveyard :: Gaia::TV, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(blocking-b2g:2.5+, b2g-v2.5 verified, b2g-master verified)

VERIFIED FIXED
blocking-b2g 2.5+
Tracking Status
b2g-v2.5 --- verified
b2g-master --- verified

People

(Reporter: cynthiatang, Assigned: Fischer)

References

Details

(Whiteboard: [ft:conndevices][partner-cherry-pick][partner-blocker])

Attachments

(1 file)

STR: 1. Receive the request for the cast video (Real TV) 2. Check the total length of video Expect result: - The total length of video should not be 00:00 Actual Result: - The total length of video is 00:00
QA Whiteboard: [COM=TV Seamless Experience]
Hi Fischer, Could you please update the analytical results? Thank you!
Flags: needinfo?(fliu)
blocking-b2g: --- → 2.5+
Whiteboard: [ft:conndevices] → [ft:conndevices][partner-blocker]
Whiteboard: [ft:conndevices][partner-blocker] → [ft:conndevices][POVB]
More information. From app side. The logic of JS code is like. console.log(video.duration) // called on evt 'durationchange' received. value will be NaN. ... console.log("metadataloaded") // called on evt 'loadedmetadata' received. ... console.log(video.duration) // called on evt 'durationchange' received. value will be displayed correctly. The first 'durationchange' & 'loadedmetadata' is fired from [1],[2]. According to w3c spec [3]. =========== ... The user agent must determine the duration of the media resource before playing any part of the media data and before setting readyState to a value equal to or greater than HAVE_METADATA, even if doing so requires fetching multiple parts of the resource. ... =========== And the 'readyState' is set here [4]. So that, app(js) should be able to obtain correct duration when the 1st 'durationchange' evt arrived. The duration is obtained from this call [5], and mDecoder should be responsible of providing it. [1] https://dxr.mozilla.org/mozilla-central/rev/ad1f85f172b7302bef0fa9780df8e2b962780ac6/dom/html/HTMLMediaElement.cpp#3391 [2] https://dxr.mozilla.org/mozilla-central/rev/ad1f85f172b7302bef0fa9780df8e2b962780ac6/dom/html/HTMLMediaElement.cpp#3395 [3] https://www.w3.org/TR/html5/embedded-content-0.html#dom-media-duration [4] https://dxr.mozilla.org/mozilla-central/rev/ad1f85f172b7302bef0fa9780df8e2b962780ac6/dom/html/HTMLMediaElement.cpp#3389 [5] https://dxr.mozilla.org/mozilla-central/rev/ad1f85f172b7302bef0fa9780df8e2b962780ac6/dom/html/HTMLMediaElement.cpp#1623 Fischer, could you provide js code for more detail.
In fling_player.js [1], the fling player get and show the video duration at the loadedmetadata event. However, the video duration is NaN at the loadedmetadata event so 00:00 is displayed. We have to wait to get the vaild video duration when the durationchange event fired afterwards. [1] https://github.com/mozilla-b2g/gaia/blob/v2.5/tv_apps/fling-player/js/fling_player.js#L386
Assignee: nobody → fliu
Flags: needinfo?(fliu)
Comment on attachment 8709363 [details] [gaia] Fischer-L:bug_1238862-fling-player-duration-0 > mozilla-b2g:master @Rex, On real TV, video duration is NaN at the loadedmetadate event so 00:00 is displayed. And valid duration would be available at the durationchange event dispatched later. To workaround this NaN duration issue, this patch listens to the durationchange event to update video duration info. Thank you
Attachment #8709363 - Flags: review?(rexboy)
Comment on attachment 8709363 [details] [gaia] Fischer-L:bug_1238862-fling-player-duration-0 > mozilla-b2g:master Looks good to me.
Attachment #8709363 - Flags: review?(rexboy) → review+
Attachment #8709363 - Flags: approval-gaia-v2.5?(jocheng)
Comment on attachment 8709363 [details] [gaia] Fischer-L:bug_1238862-fling-player-duration-0 > mozilla-b2g:master [Approval Request Comment] [Bug caused by] (feature/regressing bug #): 1238862 [User impact] if declined: The video duration would be 00:00 [Testing completed]: Yes [Risk to taking this patch] (and alternatives if risky): Low [String changes made]: None
Attachment #8709363 - Flags: approval-gaia-v2.5?(jocheng)
Comment on attachment 8709363 [details] [gaia] Fischer-L:bug_1238862-fling-player-duration-0 > mozilla-b2g:master Approve for TV 2.5
Attachment #8709363 - Flags: approval-gaia-v2.5?(jocheng) → approval-gaia-v2.5+
Whiteboard: [ft:conndevices][POVB] → [ft:conndevices][partner-cherry-pick]
Whiteboard: [ft:conndevices][partner-cherry-pick] → [ft:conndevices][partner-cherry-pick][partner-blocker]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: