【问题标题】:Ionic v1 html5 video player screen goes black but audio contiunesIonic v1 html5 视频播放器屏幕变黑但音频继续
【发布时间】:2018-08-13 17:23:03
【问题描述】:

我有一个带有 html5 视频播放器的 ionic v1 应用程序,该应用程序从 API 中提取,但是当我播放我的应用程序大约 2-3 分钟时,屏幕变黑但音频继续播放,这只发生在 android 上我该怎么做解决这个问题?

HTML:

 <div ng-repeat="item in allvods">
    <video ng-show="item.id == vodid" poster="{{item.image_2}}" 
           preload="auto" class="theplayios" height="100%" width="100%"
           webkit-playsinline controls>
      <source src="" dynamic-url dynamic-url-src="{{item.hls_stream}}"
              type="application/x-mpegURL">
    </video>
 </div>

控制器:

.controller('playvodCtrl', function($scope, $localStorage, $rootScope, $ionicPopup, $state, $stateParams, $http) {
    $scope.apiusername = 'enyigba';
    $scope.apipassword = 'cbc443cd9a3899f0b3f5c14682ae3fa1';
    $scope.vodid = $stateParams.vidId;
    $scope.vidtitle = $stateParams.vidtitle;
    $scope.catid = $stateParams.catId;
    if(typeof analytics !== undefined) {
        analytics.trackView("Playing Vod: " + $scope.vidtitle);
    }

    $scope.initEvent = function() {
        if(typeof analytics !== undefined) {
            analytics.trackEvent("Vod", "Action", "Label", 25); 
        }
    }
    $http.get('http://tvstartup.biz/mng-channel/vpanel/api/vodplaylistsion.php?user=' + $scope.apiusername + '&pass=' + $scope.apipassword + '&id=' + $scope.catid)
      .success(function(data) {
        $scope.allvods = data.videos;
    });
}) 

app.js

.directive('dynamicUrl', function () {
    return {
        restrict: 'A',
        link: function postLink(scope, element, attr) {
            element.attr('src', attr.dynamicUrlSrc);
        }
    };
})

以上是视频播放器的所有部分

【问题讨论】:

    标签: android angularjs video ionic-v1


    【解决方案1】:

    对 HTML 中的视频使用 iframe 标签&lt;iframe&gt;&lt;/iframe&gt;

    【讨论】:

    • 我用过
    猜你喜欢
    • 1970-01-01
    • 2013-04-21
    • 1970-01-01
    • 1970-01-01
    • 2022-10-06
    • 2011-11-22
    • 2014-06-10
    • 1970-01-01
    • 2019-08-19
    相关资源
    最近更新 更多