App enables background playing of videos, cordova issues, google play rejecting apps

前端 未结 5 780
孤城傲影
孤城傲影 2021-01-19 02:12

I have created a few android apps using Cordova, These are having videos in it. I am trying to upload the Apps on Google play store but every-time they are rejecting all app

5条回答
  •  余生分开走
    2021-01-19 02:32

    for those who have rejected them from the Play Store for "YouTube background play when the screen is off." or because the player still playing in background I solved with the following:

    I used this library: https://github.com/brandly/angular-youtube-embed,

    When the player is ready I assign the player to a root scope variable:

    $scope.$on('youtube.player.ready', function ($event, player) {
      $rootScope.YTPlayer = player;
    });
    

    and then i just listening the onPause of the android life cycle and stop or pause the video:

    document.addEventListener("pause", function() {
      if ($rootScope.YTPlayer) {
        $rootScope.YTPlayer.stopVideo();
       //or maybe $rootScope.YTPlayer.pauseVideo();
      }
    }, false);
    

    For ionic 2 check out this repo: https://github.com/JoxieMedina/yt-channel

    Greetings !

提交回复
热议问题