Problems embedding Youtube videos in Android

I have several problems to play youtube videos in an Android device. I know that there are a lot of post with comments about the same. But I’m not sure what i’m doing wrong.

My code is similar to this codepen:

Also, I’m setting the youtube url directly in the template. It works better. It shows the youtube look&feel but when i want to play the video only sound works.

Here attached an image about how i’m seeing my phone screen:

Also, I don’t understand why message shows that I’m accessing a local file. The links are all externals.


I don’t see any issue with your codepen. It works fine for me in my browser.

Yes, the codepen works very well, but in browser. I couldn’t make it works in my Android device.

Thanks for your time

Have you tried to white-list youtube domain in your config file? This might be the reason for android.

Yes, I have this in my module config:

app.config(function($sceProvider, $stateProvider, $sceDelegateProvider) {
$sceDelegateProvider.resourceUrlWhitelist([‘self’, new RegExp(’^(http[s]?)://(w{3}.)?$’)]);

Sorry. I meant whitelisting domain in cordova/phonegap config.xml file.

Please refer to

I think that my configuration is fine.

<access origin="*"/>

I’ve made some progress using this directive:

Now, I can see the iframe with the initial frame. When I’m playing I only listen the audio and everything is black.

Sorry. I am not able to help you in this if origin is not the problem for you.

Thanks for sharing the youtube directive.

Hmm, I took a copy of the project but I didn’t have any issues with the video.
The only thing I did though was change the format of the js.

Thank you so much for your response,

I’ve tested same code in other devices such as iPhone and other Android Tablet and it’s working.

But i’m still having the problem in Samsung Galaxy S2, Android 4.4.4, CyanongenMod last version. At the moment I don’t know how to solve it for this device.

Apart of that, I’m afraid how to assure the compatibility with all devices. I know that Crosswalk could solve this problem but I can’t publish an app with a size of more than 70mb.

Do you know how I can carry on this development and testing?

I am having the exact same experience. I’ve tried using the nightly, turning off overflow-scroll, etc. but cannot get it to work on a 4.4.4 device. It works on 4.1.1 and 5.0 Genymotion emulators and a 4.4.1 device that I’ve tested. My 4.4.4 device is a Samsung Note 4. I was wondering if it’s something specific with Samsung’s software but you say you are running CyanogenMod…

Crosswalk does solve the problem for me… was contemplating going that way but now its a fait accompli. I suspect its an underlying bug in the version of Chromium used for 4.4.4.

Same problem here. With Samsung S3 Cyanogenmod and Samsung S2 kitkat. Youtube embed videos play only with audio when put into iframe.

I have tried this but run in browser not in device please help me what actually doing wrong ?

Without seeing the code no one can help , please share your code .