如何解决角度js中的循环进度条问题?

时间:2017-01-10 09:48:36

标签: javascript jquery angularjs html5

我正在使用角度和HTML5工作视频标签我可以控制HTML5中的计时器和标签现在我想控制角度js中的圆形条形计时器当我单击新标签时圆形标签不应该移动甚至我静音声音不应该运行。

HTML

 <circular-progress id="timer_label" value="value" max="max" iterations="{{iteration}}" animation="{{animation}}" label="{{label}}" ng-click="acceptOrder()"></circular-progress>

<video autoplay onplay="clickplayer()" style="width: 100%;" id="player" ng-style="{ 'width' : width, 'height':height}" onended="endplayer()" fullscreen="true" controls  ng-src="{{videoSource | trustUrl }}" onvolumechange="myFunction()"  ontimeupdate="document.getElementById('tracktime').innerHTML = Math.floor(this.currentTime) + ' / ' + Math.floor(this.duration);"></video>

Angular JS代码

controller

    var vm = this,timeout;
    vm.value = 0;
    vm.max = ($rootScope.durationSize);
    vm.animation = "linearEase";
    vm.iterations = 60; // Accelerate animation to fit the 1 second timeout function
    vm.label = "";
    var disp = vm.max;
    vm.start = function() {
        vm.label = disp;
        timeout = $timeout(function() {
            disp = disp-1;
            vm.value++;

                if(disp == 0){
                    //console.log(disp);
                    userService.closeCampaign(userId, cid , hIPaddress, browserInfo ,function(response){
                        console.log(response);
                        if(response.status == "success"){
                            console.log($rootScope.videoSource);
                            if($scope.res.campaigns.type=="appdownload"){
                            // if($scope.res.campaigns.type=="link" || $scope.res.campaigns.type=="appdownload"){ //cutDown to open new window as empty after click the open link option
                                $rootScope.redirectlink($scope.res.campaigns.link);
                            }
                            $window.location.reload();
                        }
                        else{
                            console.log('error redirect poster');
                            $window.location.reload();
                        }
                    });      
                }
            vm.start();
        }, 1000);
    };

    vm.acceptOrder = function() {
        $interval.cancel(disp);
        // disp = vm.max - vm.value;
        disp = null;
    }


    vm.start();

0 个答案:

没有答案