In the Ionic Framework application, the application for playing youtube in a browser, but not in an Android device

In a simple Ionic app, I need to play a video on YouTube. It works fine in the browser, but does not work on the Android device itself. I referenced the code from http://plnkr.co/edit/XmyAhE?p=preview

I use the following code in my ionic application,

<ion-view view-title="{{navTitle}}">
    <ion-content has-header="true" padding="true">
        <div class="list card">
            <div class="item item-divider">
                <i class="ion-videocamera"></i>
                Video
            </div>
            <div class="padding">
                <object width="100%" height="150">
                    <param name="movie" value="https://www.youtube.com/v/WzhW20hLp6M?version=3&amp;hl=uk_UA&amp;rel=0"></param>
                    <param name="allowFullScreen" value="true"></param
                    <param name="allowscriptaccess" value="always"></param>
                    <embed src="https://www.youtube.com/v/WzhW20hLp6M?version=3&amp;hl=uk_UA&amp;rel=0" type="application/x-shockwave-flash" width="100%" height="150" allowscriptaccess="always" allowfullscreen="true"></embed>
                </object>
            </div>
        </div>  
    </ion-content>
</ion-view>

Here is the browser output screen:

enter image description here

And the output screen on the Android device:

enter image description here

Please help me.

+4
source share
2 answers

I solved the problem by adding a plugin to my application

  cordova plugin add https://github.com/apache/cordova-plugin-whitelist.git
+2
source

iframe <object></object. , iframe youtube. iframe , html5, html5 . , - . youtube.

+2

Source: https://habr.com/ru/post/1585111/


All Articles