首页 > 用angular 和ui.bootstrap的弹窗做视频播放,关闭弹窗后,视频仍在后台下载。

用angular 和ui.bootstrap的弹窗做视频播放,关闭弹窗后,视频仍在后台下载。

用angular 和ui.bootstrap的弹窗做视频播放,关闭弹窗后,视频仍在后台下载。

<script type="text/ng-template" id="ModalClaimCtrl.html">
    <div class="modal-header">
        <h4 class="modal-title" ng-bind="_video.title"></h4>
    </div>
    <div class="modal-body">
        <video ng-src="{{trustSrc(_video.video720Url)}}" style="width: 100%;height: auto;" controls>
        </video>
    </div>
    <div class="modal-footer">
        <button class="btn btn-warning" type="button" ng-click="close()">关闭</button>
    </div>
</script>

//js代码

angular.module('courseWorkManage').controller('CourseController',function (courseService,$scope, $uibModal) {
        $scope.getCourseList = function (url,params) {
            courseService.getCourseList(url,params).then(function (data) {
                $scope.courseList = data.courseList;
            });
        }
        $scope.getCourseList('testGetCourseList.do','currentPage=1')
        $scope.open = function(size,video) {
            var modalInstance = $uibModal.open({
                animation: true,
                templateUrl: 'ModalClaimCtrl.html',
                controller: 'ModalClaimInstanceCtrl',
                size: size,
                resolve: {
                    video: function () {
                        return video;
                    }
                }
            });
        };
    });

    angular.module('courseWorkManage').controller('ModalClaimInstanceCtrl',function($scope,$http, $uibModalInstance,$sce, video) {
        $scope._video = angular.copy(video);
        $scope.trustSrc = function (url) {
            return $sce.trustAsResourceUrl(url);
        }
        $scope.close = function() {
            $scope._video = null;
            $uibModalInstance.close('close');
        };
    });
【热门文章】
【热门文章】