Auto Play Not Working on Add to Homescreen - mobile

Recently Google updated Chrome to allow autoplay on mobile devices if added to homescreen, however I can not get this to work.
https://www.chromium.org/audio-video/autoplay
<div class="plyr">
<div class="embed-responsive">
<iframe
src="https://www.youtube.com/embed/{{VIDEO_ID}}?autoplay=1&rel=0&showinfo=0"
allow="autoplay; encrypted-media"
width="100%"
webkitAllowFullScreen
mozallowfullscreen
allowFullScreen>
</iframe>
</div>
</div>
I've added the autoplay tag, but it's not autoplaying in my added to homescreen application.

Related

Why is my Youtube video not showing on iFrame with Next.js and UIkit?

I have place an iFrame tag in my Next.js component.
On my website I can see the frame but it says "Youtube does not authorize this connection".
What is wrong ?
Here is my code:
<iframe
src="https://www.youtube.com/watch?v=E8gmARGvPlI"
width="1920"
height="1080"
frameBorder="0"
allowFullScreen
uk-responsive
uk-video="automute: true">
</iframe>
If you want to play youtube videos in an iframe you need to do it using their APIs. You can learn more about how to do that here - https://developers.google.com/youtube/iframe_api_reference
If you simply want to embed the video with no external control over the video you can simply embed it. More about embedding here - https://support.google.com/youtube/answer/171780?hl=en
you get the video Id by using youtube api
<iframe
id="ytplayer"
className={}
type="text/html"
width="100%"
height="360"
src={`https://www.youtube.com/embed/${videoId}?autoplay=0&origin=http://example.com&controls=0&rel=1`}
frameborder="0"
></iframe>

Angular 2 ngfor loop the value is the youtube link or another link?

<li *ngFor="let post of posts ;let i = index ">
<div *ngIf="post.link != ''">
<iframe width="100%" height="315" frameborder="0" [src]="post.link">
</iframe>
</div>
</li>
The post.link is youtube Link or another website link,
if the post.link is without youtube link hide the iframe tag.
One option.
Give your posts an extra key eg: isYoutube(boolean)
So then you can edit your ngFor:
<iframe *ngIf="post.isYoutube" width="100%" height="315" frameborder="0" [src]="post.link"></iframe>
<a *ngIf="!post.isYoutube">{{post.link}}</a>
Maybe you're looking for something like :
HTML
<div *ngIf="isYoutube(post)">
<iframe width="100%" height="315" frameborder="0" [src]="post.link"></iframe>
</div>
Component
isYoutube(post: Post): boolean {
return post && post.link && -1 < post.link.indexOf('youtu');
}
You can check that link for a post doesn't contain "youtube.com" with
*ngIf="post.link.indexOf('youtube.com') != -1"

angular variables in youtube iframe call

My code lets people select youtube videos to show. The code is written in angular and I simply want to populate the iframe components with the angular variables. Here are some of the things I have tried and none of them work.
Produces Error
<div>
<iframe width="{{obj.content.videoWidth}}"
height="{{obj.content.videoHeight}}"
ng-src="{{obj.content.url}}"
frameborder="0"
allowfullscreen>
</iframe>
</div>
Does nothing
<div>
<iframe width="{{obj.content.videoWidth}}"
height="{{obj.content.videoHeight}}"
ng-src="obj.content.url"
frameborder="0"
allowfullscreen>
</iframe>
</div>
How do I make this work?

embedded youtube videos posted by app is visible in app but embedded videos posted from web app shows as strings ionic

i have a div which contains iframe datas such as
<div class="video-container" ng-bind-html="trustedContentSce(value.content)" class="item"></div>
<p ng-bind-html="value.content"></p>
and in controller
$scope.trustedContentSce=function(value){
return $sce.trustAsHtml(value)
};
and also included following in app.config
$sceDelegateProvider.resourceUrlWhitelist(['self', new RegExp('^(http[s]?):\/\/(w{3}.)?youtube\.com/.+$')]);
I Receive data in value.content as
<iframe width="560" height="315" src="https://www.youtube.com/embed/lGP1YFE5s4M" frameborder="0" allowfullscreen></iframe>
and while posting through my app
<iframe width="560" height="315" src="https://www.youtube.com/embed/fk4BbF7B29w" frameborder="0" allowfullscreen></iframe>
which is pretty much same. isn't it?
Here is screen shot of problem i am facing (above video is posted from app and one below is posted from web
I still don't have an answer but i found a workAround. Before I used Text editor in php but when i use textarea it worked. don't know why ? isn't this:
<iframe width="560" height="315" src="https://www.youtube.com/embed/lGP1YFE5s4M" frameborder="0" allowfullscreen></iframe>
and this considered same when used ng-bind-html :
<iframe width="560" height="315" src="https://www.youtube.com/embed/fk4BbF7B29w" frameborder="0" allowfullscreen></iframe>

Angular: How to make a youtube video with dynamic src

I have a popup, and I want to show/hide by click image or youtube video`
<img ng-show="showImage" style="width: 430px;" ng-src="{{images}}">
<div ng-show="!showImage" style="width: 430px;" >
<iframe width="430" height="321" src="{{getIframeSrc(idBitches)}}" ></iframe>
</div>
But something wrong. How can I do it?

Resources