How to play restricted playback YouTube videos on android using ionic


#1

I have the following code to show youtube videos under ion-content tag

<div class="video-container">
    <iframe src="{{videoUrl}}" frameborder="0" width="560" height="315"></iframe>
 </div>

.video-container {
position: relative;
padding-bottom: 56.25%;
padding-top: 30px; height: 0; overflow: hidden; }

.video-container iframe, .video-container object, .video-container embed {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}

Its working fine in browser but when i run it on android device it simply says: ‘restricted to play on certain websites watch it on youtube’ and its not allowing me to click on watch it on youtube link.

I am using trusted url using $sce.trustedResource . I searched in google little bit and found that we need to add referrer but how to add referrer in ionic framework.

I tried with YouTube Iframe api as well but no luck same result


#2

Is there any body who faced the same issue. If yes please reply