動画の操作にハンドルを使いたいんですが、noUiSliderだと動画の再生時間に紐付けると動作がすごく遅くなります
こればっかりは自作しかないのでしょうか?
html
1<div id="form-video"> 2 <label for="video">動画を選択</label> 3 <input id="video" type="file" accept="video/*" onchange="{ changed }"></input> 4 <div class="video-wrapper" if={ preview }> 5 <video preload="auto" ref="video" onloadeddata="{ loaded }" ontimeupdate="{ playing }"> 6 <source src="{ previewSrc }" type="video/mp4"> 7 </video> 8 <div class="controls"> 9 <div class="movie-state" onclick="{ clickState }"> 10 <i class="fa fa-play click_state" aria-hidden="true"></i> 11 </div> 12 <div class="timeline" ref="timeline"></div> 13 <div class="time"> 14 <div class="now-time">{ playTime }</div> 15 <div class="slash">/</div> 16 <div class="all-time">{ totalTime }</div> 17 </div> 18 </div> 19 </div> 20 </div>
javascript
1 this.loaded = function() { 2 3 var totalSecond = Math.floor(this.refs.video.duration) 4 this.playTime = '0:00' 5 this.totalTime = timeFormat(this.refs.video.duration) 6 7 8 9 noUiSlider.create(this.refs.timeline, { 10 start: 0, 11 connect: true, 12 orientation: "horizontal", 13 step: 0.000001, 14 range: { 15 'min': 0, 16 'max': totalSecond 17 }, 18 format: wNumb({ 19 decimals: 0 20 }) 21 }) 22 23 this.refs.timeline.noUiSlider.on('start', function(e) { 24 tag.refs.video.pause() 25 }) 26 27 this.refs.timeline.noUiSlider.on('end', function(e) { 28 if (playState) { 29 tag.refs.video.play() 30 } 31 }) 32 33 this.refs.timeline.noUiSlider.on('slide', function(e) { 34 tag.refs.video.currentTime = e[0] 35 }) 36 37 }
回答1件
あなたの回答
tips
プレビュー