Closed Bug 1272565 Opened 4 years ago Closed 4 years ago

canplay or onerror are never fired

Categories

(Core :: Audio/Video: Playback, defect, P1)

defect

Tracking

()

RESOLVED FIXED
mozilla49
Tracking Status
firefox47 --- wontfix
firefox48 --- fixed
firefox49 + fixed

People

(Reporter: tsmith, Assigned: jwwang)

References

Details

(Keywords: regression)

Attachments

(5 files, 1 obsolete file)

Attached file test_case.html (obsolete) —
When running the attached test case (test_case.html) only the loadedmetadata event is fired.

None of the following events are fired:
error
canplay
canplaythrough
loadeddata

I'm not sure what should be fired in this situation I believe jya should be able to add more details if needed.
Attached video test_case.mp4
Attached video original.mp4
Attached file test_case.html
Attachment #8752055 - Attachment is obsolete: true
https://hg.mozilla.org/mozilla-central/annotate/c3f5e6079284a7b7053c41f05d0fe06ff031db03/dom/html/HTMLMediaElement.cpp#l3968

The readyState can't advance because the file has no video frames but only audio.

The change is from bug 879717 which fixed some media stream bugs. Should we apply the logic to the media stream case only?
Flags: needinfo?(pehrsons)
Hi Tyson,
Can you try if this patch fix the problem?
Flags: needinfo?(twsmith)
Depends on: 879717
Keywords: regression
Summary: canplan or onerror are never fired → canplay or onerror are never fired
Assignee: nobody → jwwang
I discussed this with JW on IRC. It's only a problem when the video track contains no frames at all.

His idea of passing that to the VideoTrackInfo as a duration of 0 or similar, and taking that into consideration when we have a decoder sounds fine by me.
Flags: needinfo?(pehrsons)
I should also mention, the reason I don't want to remove the check for when the decoder case completely is canvas2d.drawImage(videoElement). It returns early if readyState < HAVE_CURRENT_DATA, but otherwise throws if there's no Image yet in the video elements ImageContainer. According to JW there was no guarantee that the ImageContainer holds an image when we'd reach HAVE_CURRENT_DATA without the check, so checking makes sense.
Verified the patch fixes this issue.

I'm now see another similar but I think unrelated issue. I'll log a new bug.
Flags: needinfo?(twsmith)
See Also: → 1272731
(In reply to Andreas Pehrson [:pehrsons] (Telenor) from comment #6)
> His idea of passing that to the VideoTrackInfo as a duration of 0 or
> similar, and taking that into consideration when we have a decoder sounds
> fine by me.

Too bad that MediaInfo::mVideo.mDuration returns 50000 for test_case.html. Need to find other ways to check if this video track contains no frames at all.
As suggested by jya that Chrome and Safari draw a black image when there are no frames in the video track, I will take a similar approach to ensure 'loadeddata' is fired when no frames in the video track at all.
Tracking for 49 since it would good to get this fixed :jwwang - Will uplift needed for this one?
Flags: needinfo?(jwwang)
Comment on attachment 8754695 [details]
MozReview Request: Bug 1272565 - draw a blank image when no frames in the video track.

https://reviewboard.mozilla.org/r/54184/#review51306
Attachment #8754695 - Flags: review?(cpearce) → review+
Thanks!
https://hg.mozilla.org/mozilla-central/rev/4d6593879275
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla49
Comment on attachment 8754695 [details]
MozReview Request: Bug 1272565 - draw a blank image when no frames in the video track.

Approval Request Comment
[Feature/regressing bug #]:1272565
[User impact if declined]:some events won't be fired when playing a video without any video frames. This patch is to make some fuzzing tests happy.
[Describe test coverage new/current, TreeHerder]:TreeHerder
Aurora: https://treeherder.mozilla.org/#/jobs?repo=try&revision=1c98c5c7a6ea
Beta: https://treeherder.mozilla.org/#/jobs?repo=try&revision=c0cd0c1f7860
[Risks and why]: Low. The change is simple and it only affect playback of video without video frames which are very rare and only useful in fuzzing cases.
[String/UUID change made/needed]:none
Flags: needinfo?(jwwang)
Attachment #8754695 - Flags: approval-mozilla-beta?
Attachment #8754695 - Flags: approval-mozilla-aurora?
Comment on attachment 8754695 [details]
MozReview Request: Bug 1272565 - draw a blank image when no frames in the video track.

Let's uplift to Aurora48. At this point in Beta47 cycle, I am only taking fixes for issues that would lead to a dot release (such as critical regressions, sec, stability issues only). This does not meet the Beta uplift bar.
Attachment #8754695 - Flags: approval-mozilla-beta?
Attachment #8754695 - Flags: approval-mozilla-beta-
Attachment #8754695 - Flags: approval-mozilla-aurora?
Attachment #8754695 - Flags: approval-mozilla-aurora+
You need to log in before you can comment on or make changes to this bug.