Casting a webpage with autoplaying unmuted video on the Chromecast - google-chrome

I've managed to cast a LAN hosted dashboard page to the chromecast, using https://boombatower.github.io/chromecast-dashboard/sender/.
However, the HTML5 video tag will not play without the muted attribute (and trying to unmute causes it to pause). Here is the error: "Unmuting failed and the element was paused instead because the user didn't interact with the document before". It has to do with Chrome policy, of course.
Is there any way to cause interaction with the Chromecast to perhaps allow unmuting? I've tried to press the pause button on my TV to send an event via CEC (it works on the media controller), but the videos still get muted.

I figured it out. I need to mark the video element using the chromecast api. So I had to create my own Cast app.
There isn't a way to do this with the given dashboard app. It wraps the user's page inside an iframe, and there is just no way to access the chromecast api from inside.

Related

How do I bypass Chrome's Autoplay policy the same way as Youtube does?

I need to make a video autoplay with sound when visited via a deeplink.
According to https://developer.chrome.com/blog/autoplay/, it is not allowed, because the video is NOT muted.
However, if you open a Youtube video in a Guest Chrome tab (meaning Media Engagement Index is empty and doesn't matter here), it autoplays, and it has sound.
That means Youtube bypasses the Chrome policy, is that correct? I saw other websites do the same as well.
I am wondering how to do the same in my app. Could anyone teach me?
Note: the video in my app is from a 3rd party and is embedded in my app, that means the video's URL has a different domain from my app's. But I think it shouldn't matter.
Thanks in advance!

Embedded Vimeo videos lost controls and logo after starting Pro trial

I was able to embed Vimeo video just fine with the Basic account. However, I now started Pro trial and all controls disappeared. So, if I pass playing={true} to <ReactPlayer>, the video plays just fine. Otherwise, it looks as a screenshot of the first frame of the video. Even the Vimeo logo does not appear.
The controls are enabled in the video's settings (and appear in the player inside Vimeo):
What could be the reason for the controls not showing in the embedded videos?
I had to explicitly pass controls={true} to <ReactPlayer>. It is unexpected and surprising that this is not the default...

Force opening app for embedded youtube video

I would like to embed a youtube video (with the standard iframe). Can I ensure that the video is played in the youtube app, if it is clicked on using a smartphone?
For completeness my video including code (using bootstrap 3.3.1.):
<div class="embed-responsive embed-responsive-16by9">
<iframe class="embed-responsive-item" src="https://www.youtube.com/embed/<?php echo $Elem->video; ?>">
</iframe>
</div>
Thank you
I'm just trying to do the same thing and I can tell you that there is no native way to specify that behaviour as a parameter.
The only workaround (I'm still trying to implement it) is to use YouTube's Player API for iframe. I think you should use that API to embed the video on the webpage and add a listener to the first "play" event, in that event you should check if the user is using a mobile device (using another JS library to check that) and stop the playback (the stop() API call will also stop the loading of the video file) and then redirect the user to the video URL (like youtube.com/xxxxxx). At that time, at least in Android, the user will be asked to open the link in the browser or the YouTube app. I think most user have the app as the default option.
That's the idea, I'll try it and if it works will edit this response with the code I've used.
This is the link where you can read about embedding the player, it's events and API calls: https://developers.google.com/youtube/iframe_api_reference#Loading_a_Video_Player

What happens to webRTC/getUserMedia if hidden?

I'm building a website where you can open a modal view with a video-tag for the users web cam video.
Now I'm wondering what happens to my video stream/the content of the video-tag when the user closes the modal view (the view is hidden via display: none).
Is webRTC still running? Are the resources still reserved?
Thanks
Yes, even if you don't attach the received stream to any media element, the stream is still being played. This is valid for remote and local streams. Of course, if it has audio, you will only hear it when it is attached to a media tag (audio or video).
You can even remove media elements from the page. When they get back on dom, if you attach the stream, they will continue to play.

iOS HTML5 video player next/prev buttons

Is there a way to access/listen to the previous/next buttons in the iOS HTML5 video player? Ideally I would listen to some sort of a prev and next event and swap out the videos accordingly without the user having to close the video and click my prev/next buttons.
(source: iphonefaq.org)
I am currently using jwplayer to generate the html5 video and listening to their playlist next/prev listeners don't seem to do the trick. I can always find and attach listeners to the actual <video> tag pretty easily though.
If you attach listeners to the video tag itself then when the user hits next and previous then the listeners in the code will put up on those buttons. I am doing something similar with youTube videos. If you hit next it goes to the end of the youtube video and fires a video complete event tag and then I load the next video when that is called, so that the video will one loop without the next button and two the users can hit the buttons. I have not found a way to monitor the buttons in the player on the iphone side, but if I find it I will post that as well since it is important to know both angels if possible.
Funny thing I think I am looking to try and do the same exact thing. I know how to transition the videos to the next without having to leave the fullscreen mode because of using youTube api in the js but I am not able to observe the quicktime player itself and need to for another feature that I would like to work on.
That's the native iOS player which is a thin version of Quicktime. You'll know if it's an HTML5 player when it doesn't transition from the Quicktime player and your page in Safari. How is your movie being embedded?
I recently had a similar problem and was unable to find a solution using the HTML player. I ended up implementing the video player using MPVideoPlayer Framework and launching it from my web view with a custom URL scheme (AppName:Commnad:Asset). I was then able to use the delegate methods to monitor user interactions. If you would like to see basic implementation, let me know and I can add some code.