WebRTC Remote Video doesnt autoplay if unmuted with Safari in iOS 11 - html

As we know for an HTML5 video, "Playback will start automatically for a video element once it comes into view if both autoplay and muted are set"
Also "It's possible to unmute a video programmatically in response to a user gesture such as a click, but if you attempt to unmute a video programmatically without a user gesture, playback will pause."
Hence for a video calling app, If I want an autoplay of the remote videos, I have to keep them muted until there is a user gesture. This kills the user experience. Kindly help how to manage autoplay of remote video in unmuted state for voice. I am testing with Safari in iOS 11.2

see https://webkit.org/blog/7763/a-closer-look-into-webrtc/ in the section "Media Capture and Autoplay Video" -- if you are capturing from getUserMedia you are probably good.
https://github.com/webrtc/samples/issues/929 has some notes on useful properties you might want to set.

Related

How does youtube autoplay video with music when we land to some channel's homepage

After chrome version 66 autoplay of video with music was not allowed and if we want to autoplay any video we need to keep the video muted but currently when I was going through some youtube channel page and there when I land on the page the video would autoplay with the music and they are also using video API of HTML only when I inspected that player so how is youtube able to autoplay their video with audio. Any ideas ?
For reference if you go to this youtube link the video would autoplay with voice.
Any idea how this is happening ? Curious to know about it.
Music is not allowed to autoplay and even if it does it has to be muted, yes.... But, I don't think the same applies for embeds, I believe, youtube bypasses this by embedding the video onto the channel page, I may be wrong.

Google Chrome is not playing Autoplay Media Audio (.mp3), while other browsers does play

MY WEBSITE::: https://mslen.heliohost.org/CMASHOUSE.html
It's a basic page. Audio is not playing on chrome, but plays on IE
Secondly, as an alternate would play when user clicks. I don't want the control to show on the page...wants the control to be hidden
PROBLEM HAS BEEN SOLVED!
Chrome doesn't allow Autoplay unless user interacts with website first, ie, clicks somewhere in the page. This is so a user doesn't open 5 tabs and has audio play from all 5 tabs in the background before they've clicked in to the tab. You can read more about it here.
As for hiding the controls, modify your <audio> tag not to include controls.
Ie, where you have:
<audio controls autoplay loop="99">
Replace with;
<audio autoplay loop="99">
Here and here you can find more info about the <audio> tags.

How to enable autoplay in html page. In chrome latest its not working

Team,
My code
<audio autoplay id='myAudio' >
<source src="abc.mp3" type="audio/mp3">
<source src="abc.mp3" type="audio/mpeg">
</audio>
As this was not working a function was called onload and mocked the event of clicking a button.
to resolve the error "play() failed because the user didn't interact with the document first"
My chrome build is 78.xx . I know google have disabled this feature . I tried with iframe also but doesnt work. Any help is appreciated.
Google Chrome only allows you to use autoplay on the next scenarios:
If muted is also added to the audio tag.
User has interacted with the domain (click, tap, etc.)
The user has added the site to their home screen on mobile or installed the PWA on desktop.
Chrome knows if the interaction is genuine or if it's mocked, so I don't suggest that way. My suggestion is make your website a PWA, or think a way to make the user interact with the website.
Source: https://developers.google.com/web/updates/2017/09/autoplay-policy-changes

Youtube iframe src autoplay not working in chrome browser

I have attached this iframe code to my plain html page. here i want to make an auto play when the page is loaded. i tried in firefox its working fine for me . when i load in chrome its not getting the autoplay.
my code is <iframe width="420" height="345" src="https://www.youtube.com/embed/qsP3Y4hHyeM?autoplay=1">
</iframe>
its working fine for firefox browser . but when am loading to the chrome browser its not working.
anybody could you please help me ?
any thing i have to make extra parameters?
Thankyou.
This is a feature introduced by the Chrome development team back in 2018: https://developers.google.com/web/updates/2017/09/autoplay-policy-changes
and a related requirement: https://developers.google.com/web/updates/2017/09/autoplay-policy-changes#iframe
The article explains what conditions, regarding the embedded audio/video content & regarding the user interaction, are being required in order to make Autoplay functioning:
Muted autoplay is always allowed.
Top frames can delegate autoplay permission to their iframes to
allow autoplay with sound
<!-- Autoplay is allowed. -->
<iframe src="https://cross-origin.com/myvideo.html" allow="autoplay">
<!-- Autoplay and Fullscreen are allowed. -->
<iframe src="https://cross-origin.com/myvideo.html" allow="autoplay; fullscreen">
Autoplay with sound is allowed if:
User has interacted with the domain (click, tap, etc.).
On mobile, the user has [added the site to their home screen].
On desktop, the user's Media Engagement Index threshold has been crossed, meaning the user has previously play video with sound.
Media Engagement Index (MEI)
The MEI measures an individual's propensity to consume media on a site. Chrome's current approach is a ratio of visits to significant media playback events per origin:
Consumption of the media (audio/video) must be greater than 7
seconds.
Audio must be present and unmuted.
Tab with video is active.
Size of the video (in px) must be greater than 200x140.
The chrome developer team disabled the autoplay feature to avoid irritation among users because of the automatic video play. You can enable it by the following steps:
Opening a Chrome browser and typing: chrome://flags/#autoplay-policy
Changing the "Autoplay policy" from "Default" to "No user gesture is
required"
Pressing "relaunch"
Rebooting the device
From now on autoplay works again in webview components used in your app.

HTML5 Video not showing on Mac OS X (Desktop) CNA (Captive Network Assistant)

I'm building a captive portal for free wifi access. When user connects, the CNA pops up in the screen where my portal is loaded.
Problem: HTML5 video is not being displayed in OS X desktop. Even iPhone can show it, desktop doesn't. I cannot even inspect anything in this evil browser (can it be called a browser? I don't think so).
My video code:
<video id="promo-video" height="100%" width="100%" preload="auto" autoplay="" muted="" webkit-playsinline="" playsinline="">
<source src="externalUrlToVideo" type="video/mp4">
</video>
Remember, this very same code shows video on iOS (but doesn't autoplay... for now it's a minor problem).
Some screenshots* that may help some. Video should be played in the right column:
CNA doesn't loads video
What happens when I right-click video then click "Show controls"
Also, when I right-click then click "Open video in a new window", it shows only a video player, but nothing to be showed in it. Obviously, play button doesn't make it work...
You could try adding the type="" attribute to the source. Include the video MIME-type there, e.g.
type="video/mp4"
Also, I don't think video will autoplay on iOS. Historically it has prevented auto-playing because of data charges for downloading video content. I'm not sure if I recently read somewhere that was changing. From a user perspective it's arguably unfair to hammer their data allowance with auto-playing videos even if the aesthetic or UX is improved by it.