# Embed youtube iframe to ionic 2

**URL:** <https://forum.ionicframework.com/t/embed-youtube-iframe-to-ionic-2/62664>\
**Category:** ionic-v3\
**Created:** [September 6, 2016, 7:56am UTC](https://forum.ionicframework.com/t/embed-youtube-iframe-to-ionic-2/62664 "2016-09-06T07:56:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![eheading](https://avatars.discourse-cdn.com/v4/letter/e/0ea827/32.png) [@eheading](https://forum.ionicframework.com/u/eheading)\
**Post date:** [September 6, 2016, 7:56am UTC](https://forum.ionicframework.com/t/embed-youtube-iframe-to-ionic-2/62664/1 "2016-09-06T07:56:57Z")

</div>

I want to embed some youtube video in ionic2, I have done below steps to tell angular that iframe is a safe and trusted url:

in index.html  
`<meta http-equiv="Content-Security-Policy" content="font-src 'self' data:;img-src * data:; default-src * 'unsafe-eval' 'unsafe-inline'">`

in youtubePage.ts  
`import { SafeResourceUrl,DomSanitizationService} from '@angular/platform-browser'; constructor(private sanitizer: DomSanitizationService) { this.trustednews = sanitizer.bypassSecurityTrustHtml(youtubelink); }`

in youtubePage.html  
`<div [innerHTML]="trustednews"></div>`

Result :  
I can view the embedded youtube iframe in browser mode when running “ionic server —lab”

However, when I deployed to Android device, it’s missing. May I know is there any idea?

Many thanks.
