Closed Bug 1303993 Opened 8 years ago Closed 8 years ago

"Save audio" option displayed when long tapping a video

Categories

(Firefox for Android Graveyard :: Audio/Video, defect, P2)

defect

Tracking

(firefox49 affected, firefox50 affected, firefox51 affected, firefox52 affected, firefox53 verified)

RESOLVED FIXED
Firefox 53
Tracking Status
firefox49 --- affected
firefox50 --- affected
firefox51 --- affected
firefox52 --- affected
firefox53 --- verified

People

(Reporter: u549602, Assigned: timdream)

References

Details

Attachments

(1 file)

Environment: Aurora Device: Samsung Galaxy S6 EDGE (Android 6.0 ); Build: Aurora 51.0a2 (2016-09-20); Steps to reproduce: 1. Go to http://people.mozilla.org/~atrain/mobile/tests/media.html 2. Long tap on a video 3. Play the video 4. Long tap again on the video Expected result: @ Step 2: The context menu appears with the Save Video option @ Step 4: Same as step 2 Actual result: @ Step 2: The context menu appears with the Save Audio option @ Step 4: The context menu appears with the Save Video option Notes: Please note that even if the user taps on Save Audio option, the download resulted is the correct video. This issue is present on all devices and all Android versions. For further details please check : https://www.youtube.com/watch?v=aN7aXnR5D5k
Good job to find this problem!
Priority: -- → P2
I cannot see this problem on desktop Firefox. Ray, Can you help check this bug?
Flags: needinfo?(ralin)
The context menu display item accordingly. I narrowed down the possible condition that what situation for which button to show up [0]. I guess one of the condition is fulfilled in certain state while playing (maybe size or readyState?) and make menu change from Save Audio to Save Video. I will test that tomorrow since I got no devices in hands. Thanks. [0] https://dxr.mozilla.org/mozilla-central/rev/62f79d676e0e11b3ad59a5425b3ebb3ec5bbefb5/browser/base/content/nsContextMenu.js#723-731
Flags: needinfo?(ralin)
Some points cause this issue: First, mobile's preference default not to preload data [0] but desktop default does. That's the main cause why the behavior between desktop and mobile is different. Note that when the "media.preload.default" is set to 1, video's "readyState" will remain "HAVE_NOTHING" till user click and play video. Second, according to second paragraph of videoWidth/Height spec [1]: "The videoWidth IDL attribute must return the intrinsic width of the video in CSS pixels. The videoHeight IDL attribute must return the intrinsic height of the video in CSS pixels. If the element's readyState attribute is HAVE_NOTHING, then the attributes must return 0." Follow with first point and the spec, if video haven't been played by user, the attributes videoWidth and videoHeight would return 0. Unfortunately, the condition just fulfill the statement[2] which determine isAudio or not. This explain why "Save Audio" shows before video played. I think mobile's behavior is intended for saving bandwidth, however, it cause the misleading message. IMHO, this seems to be inevitable since we could not tell isAudio or isVideo unless we preload some of data (metadata). [0] https://dxr.mozilla.org/mozilla-central/rev/62f79d676e0e11b3ad59a5425b3ebb3ec5bbefb5/mobile/android/app/mobile.js#602-603 [1] https://html.spec.whatwg.org/#dom-video-videowidth [2] https://dxr.mozilla.org/mozilla-central/rev/62f79d676e0e11b3ad59a5425b3ebb3ec5bbefb5/mobile/android/chrome/content/browser.js#926-928
There is no way to tell whether a file contains audio or video tracks before loading metadata. Can we just use a neutral text like "Save media" or "Save file" to fix this issue?
Annotate [2] I found bug 791654. The justification is commented here: http://searchfox.org/mozilla-central/rev/8910ca900f826a9b714607fd23bfa1b37a191eca/mobile/android/chrome/content/browser.js#911-912 // If a video element is zero width or height, its essentially // an HTMLAudioElement. which I can't really say I agree. :antlam, would you might tell us the preferred solution here? We couldn't workaround comment 5 so we would either have to show "Save media" or "Save file" sometimes, or we would have to remove the mentioned behavior here, and always show "Save Video" for video element and "Save Audio" for audio element.
Blocks: 791654
Flags: needinfo?(alam)
Spoke in person. Sorry this took so long but I think "Save media" makes the most sense.
Flags: needinfo?(alam)
Assignee: nobody → timdream
Status: NEW → ASSIGNED
Comment on attachment 8811113 [details] Bug 1303993 - Display "Save Media" for long tapping unloaded video, https://reviewboard.mozilla.org/r/93334/#review93336 LGTM
Attachment #8811113 - Flags: review?(s.kaspari) → review+
Pushed by cbook@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/4a380f84548d Display "Save Media" for long tapping unloaded video, r=sebastian
Keywords: checkin-needed
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 53
Hello, I've verified this issue and "Save Media" is indeed being displayed now before playing a video and changes to "Save Video" once you hit the play button since the video does not have a zero width or height anymore.
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: