Closed Bug 1094310 Opened 10 years ago Closed 10 years ago

"View Video" context menu doesn't work with mediasource

Categories

(Toolkit :: Video/Audio Controls, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla36
Iteration:
36.3

People

(Reporter: MattN, Assigned: kinetik)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 1 obsolete file)

STR: 1) Load https://www.youtube.com/watch?v=V8SjkDq2ZwI 2) Hold Shift and right-click on the video to see the Firefox context menu 3) Choose "View Video" Expected result: * The video opens in a new tab. * If this isn't technically possible, then the menu item should be disabled Actual result: * Nothing happens Also note that "Copy Video Location" also isn't helpful for the user AFAICT (I'm not familiar with media source extensions) as it gives a URI like: mediasource:https://www.youtube.com/a1a13094-a089-944a-b867-e7953f0425a6 which I don't think can be navigated to.
Flags: firefox-backlog?
(In reply to Matthew N. [:MattN] (focused on Loop) from comment #0) > * The video opens in a new tab. > * If this isn't technically possible, then the menu item should be disabled I don't think it is, because the data feeding media playback is controlled by third-party script in the document. > Also note that "Copy Video Location" also isn't helpful for the user AFAICT > (I'm not familiar with media source extensions) as it gives a URI like: > mediasource:https://www.youtube.com/a1a13094-a089-944a-b867-e7953f0425a6 > which I don't think can be navigated to. You're right, that's an internal UUID and isn't reusable.
Don't set this.mediaURL for media with an internal "mediasource:" URL, since they can't be reused. This effectively disables "view video", "copy video location", etc.
Attachment #8517883 - Flags: review?(gavin.sharp)
Comment on attachment 8517883 [details] [diff] [review] p1: disable context menu items for URLs for MSE media Review of attachment 8517883 [details] [diff] [review]: ----------------------------------------------------------------- ::: browser/base/content/nsContextMenu.js @@ +627,5 @@ > else if (this.target instanceof HTMLCanvasElement) { > this.onCanvas = true; > } > else if (this.target instanceof HTMLVideoElement) { > + var mediaURL = this.target.currentSrc || this.target.src; I think you should use |let| instead of |var| to avoid a possible warning about re-declaring the |mediaURL| variable. @@ +643,5 @@ > } > } > else if (this.target instanceof HTMLAudioElement) { > this.onAudio = true; > + var mediaURL = this.target.currentSrc || this.target.src; ditto @@ +1511,5 @@ > return !this.focusedWindow.getSelection().isCollapsed; > }, > > + isMediaURLReusable: function(aURL) { > + return !/^mediasource:/.test(aURL); I'm guessing we have the same problem with blob URIs too, right?
(In reply to Matthew N. [:MattN] (focused on Loop) from comment #3) > I think you should use |let| instead of |var| to avoid a possible warning > about re-declaring the |mediaURL| variable. Right, thanks! > I'm guessing we have the same problem with blob URIs too, right? That seems likely, yeah.
Comment on attachment 8517883 [details] [diff] [review] p1: disable context menu items for URLs for MSE media What Matt said, but also it would be ideal if there was an API on VideoElement (or some ancestor) for determining "has shareable URL" that didn't involve the frontend doing regexp comparisons on string attributes. Is that doable?
Flags: needinfo?(kinetik)
Something like that seems possible (and preferable, I agree), but unfortunately I don't have time to work on it right now.
Flags: needinfo?(kinetik)
Flags: firefox-backlog? → firefox-backlog+
Comment on attachment 8517883 [details] [diff] [review] p1: disable context menu items for URLs for MSE media It will be confusing for the user that some videos have this functionality while others don't. Not sure there's an easy way to address that, though. Please adjust the patch per Matt's suggestions, r=me with that.
Attachment #8517883 - Flags: review?(gavin.sharp) → review+
Address review comments.
Assignee: nobody → kinetik
Attachment #8517883 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla36
Iteration: --- → 36.3
Flags: qe-verify?
Flags: qe-verify? → qe-verify-
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: