2014-06-05 3 views
0

Ionic-Framework로 작업 중이며 비디오를 재생할 때 Videogular 플러그인을 사용하고 있습니다. 하지만 iOS에서 에뮬레이션 할 때 데스크톱에서는 자동 실행되지 않습니다.iOS 용 비디오 자동 재생이 앱에서 작동하지 않습니다.

내 HTML :

<videogular vg-width="config.width" 
vg-height="config.height" 
vg-theme="config.theme.url" 
vg-autoplay="config.autoPlay" 
vg-stretch="config.stretch.value" 
vg-responsive="config.responsive"> 
<video class='videoPlayer' controls preload='none'> 
    <source src='assets/videos/level1.mp4' type='video/mp4'> 
    <source src='assets/videos/level1.ogv' type='video/ogg'> 
</video> 

<vg-overlay-play>Test</vg-overlay-play> 
</videogular> 

모듈 : 당신은 모바일 장치에 자동 재생 할 수

angular.module('starter', [ 
         'ionic', 
         'starter.controllers', 
         'starter.services', 
         "com.2fdevs.videogular", 
         "com.2fdevs.videogular.plugins.controls", 
         "com.2fdevs.videogular.plugins.overlayplay", 
         "com.2fdevs.videogular.plugins.buffering", 
         "com.2fdevs.videogular.plugins.poster" 
         ]) 

.run(function($ionicPlatform) { 
$ionicPlatform.ready(function() { 
    // Hide the accessory bar by default (remove this to show the accessory bar above the keyboard 
    // for form inputs) 
}); 
}) 

답변

0

, 그것은 OS에서 기본적으로 사용되지 않습니다.

+1

그러면 페이스 북은 어떻게합니까 –

+0

아무 때나 탭/클릭해야하며 동영상을 재생하기 위해 이벤트를 가져옵니다. 거의 모든 브라우저에서 문서화 된 사양입니다. 대역폭 소비를 피하기 위해 비디오를 자동 재생할 수 없으므로 다운로드를 허용해야하는 사용자 여야합니다. – elecash

+0

음, 어떻게 든 재생할 수있었습니다. 몇 가지 일을했지만 자동 재생 = "자동 재생"기능을 추가했기 때문에 정확히 무엇을했는지 모르겠습니다. 시도한 마지막 사항이었습니다. –

0

나는 그럭저럭 일할 수 있었지만 정확히 어떻게 작동하는지 알지 못합니다. 내가 노력 마지막 것은에서 자동 재생 = "자동 재생"을 넣어

<videogular id="intro-video" vg-width="config.width" 
vg-height="config.height" 
vg-theme="config.theme.url" 
vg-autoplay="config.autoPlay" 
vg-stretch="config.stretch.value" 
vg-responsive="true"> 
<video class='videoPlayer' autoplay='autoplay' webkit-playsinline> 
    <source src='assets/videos/level1.mp4' type='video/mp4'> 
    <source src='assets/videos/level1.ogv' type='video/ogg'> 
</video> 
</videogular> 
1

당신은 videogular 태그에 VG-자동 재생 = "true"로 사용해야합니다.

<videogular vg-autoplay="true"> 

전체 예 :

<div class="videogular-container"> 
    <videogular vg-player-ready="onPlayerReady()" vg-complete="onCompleteVideo()" vg-theme="config.theme.url" vg-autoplay="true"> 
     <vg-video vg-src="config.sources" vg-tracks="config.tracks" vg-preload="config.preload"></vg-video> 

     <vg-controls vg-autohide="config.plugins.controls.autoHide" vg-autohide-time="config.plugins.controls.autoHideTime"> 
      <vg-play-pause-button></vg-play-pause-button> 
      <vg-timedisplay>{{ currentTime | date:'mm:ss' }}</vg-timedisplay> 
      <vg-scrubBar> 
       <vg-scrubbarcurrenttime></vg-scrubbarcurrenttime> 
      </vg-scrubBar> 
      <vg-timedisplay>{{ timeLeft | date:'mm:ss' }}</vg-timedisplay> 
      <vg-volume> 
       <vg-mutebutton></vg-mutebutton> 
       <vg-volumebar></vg-volumebar> 
      </vg-volume> 
      <vg-fullscreenButton></vg-fullscreenButton> 
     </vg-controls> 

     <vg-overlay-play></vg-overlay-play> 
     <vg-buffering></vg-buffering> 
     <vg-poster-image vg-url='config.plugins.poster'></vg-poster-image> 
     <div class="my-logo-layer" ng-show="API.currentState != 'play'"> 
      <img src="http://www.videogular.com/img/videogular.png"> 
     </div> 
    </videogular> 
</div> 
관련 문제