InAppBrowser does not play Youtube videos on full screen mode in ionic

前端 未结 2 1390
攒了一身酷
攒了一身酷 2021-01-15 23:23

I am developing an Android app using Cordova and Ionic framework. I am playing a YouTube video with InAppBrowser using the code below:

window.open(\'https://         


        
2条回答
  •  误落风尘
    2021-01-15 23:39

    Use embed URL and this should work.

    window.open('https://www.youtube.com/embed/v8WjMiodcKo');
    
    1. EDIT

    Second option is to use '_system', as in example

    window.open('https://www.youtube.com/watch?v=v8WjMiodcKo', '_system');
    
    1. EDIT

    3.1. Download this npm package $ npm install --save angular-youtube-embed.

    3.2. Copy angular-youtube-embed.js from \node_modules\angular-youtube-embed\src\angular-youtube-embed.js to www\js

    3.3. Add 'youtube-embed' dependency in app.js

    3.4. Add this to index.html

    
    
    

    3.5. Create a controller

    .controller('YoutubeCtrl', function($scope) {
           $scope.BestFriends = 'v8WjMiodcKo';
    }) 
    

    3.6. Add this to html page

    
    

提交回复
热议问题