Open jaredhirsch opened 8 years ago
We should try HTMLMediaElement.captureStream
. Come to #media on mozilla's irc if you want to chat about it (same nick, Paris timezone).
This call allows forwarding an HTMLMediaElement to another one (using a MediaStream to connect the two), sharing all the resources behind the scene (decoders, frames, etc.). It's kind of standard (there is a spec, but we don't respect it to the letter), maybe you need a moz
prefix.
In any case, this is awesome, and we (people doing media work in gecko) will be happy to talk if you need or want to know anything.
Links:
@padenot Sounds great! I'll ping you tomorrow. How late are you around in the evenings? Does 6pm Paris time work?
Yep, should be alright.
After looking over @padenot's comments in #media this morning to @6a68, I tried hacking together a version of this with the sdk. I assumed there would be some permissions issues, and there was.
Here is a list of steps describing what we want to achieve:
The main problem here is getting the mediastream
object out of the page/pagemod and into the new window.
My next steps are digging into Components.utils.Sandbox and nsIPrincipal.
I hoping that we can change some permissions of our sandbox and allow this object to be passed from outside of the original url into the new window using something like SharedWorkerGlobalScope
I'll also mention that @padenot also mentioned taking a look at nsIAudioChannelAgent.idl but I'm not quite there yet.
@paulrouget Hey, @padenot mentioned that you might have experience passing media streams across window boundaries. We're trying to send a video stream to a separate window (XUL or regular HTML window). Any suggestions on an approach that might work?
I'm starting to think that passing a DOM element or reference may not be the best way to do this. If we can get access to the global store of MediaElement objects, maybe we can pass a reference into a second window. Need to figure out where that store is...
Is development still ongoing?
If it will take much longer to implement this, how about a more straightforward implementation for plain HTML videos? Would seem to be an incremental win for user-facing features.
@paulrouget Hey, @padenot mentioned that you might have experience passing media streams across window boundaries. We're trying to send a video stream to a separate window (XUL or regular HTML window). Any suggestions on an approach that might work?
Sorry for the late reply. I indeed built a similar thing a while ago. iirc, i created a protocol handler that would create a video that would play the stream of another video. The stream was created via mozCaptureStream
and transferred to the new window via as an URL. Something like URL.createObjectURL(video.mozCaptureStream());
.
2 relevant links:
Hi whats the status of this? I'd love to add support into my HTML 5 player for this.
@znap026 Hey there, We currently support a wide range of html5 videos through the context menu option. We haven't come up with a way to apply the overlay icon to
I'm watching videos from 34C3 [0], and have neither icon nor context menu. Same when I open the video directly. Could this be due to the videos being served over FTP (e.g., [1], from [2])?
[0] https://media.ccc.de/c/34c3 [1] https://ftp.fau.de/cdn.media.ccc.de//congress/2017/h264-hd/34c3-9027-eng-The_Work_of_Art_in_the_Age_of_Digital_Assassination.mp4 [2] https://media.ccc.de/v/34c3-9027-the_work_of_art_in_the_age_of_digital_assassination
We have legal approval to support any video element if:
Need to figure out the best way to clone a playing video element into the min vid panel. Maybe Document.importNode?