質問編集履歴

1

コード追加

2017/02/01 03:25

投稿

NobumitsuHata
NobumitsuHata

スコア141

test CHANGED
File without changes
test CHANGED
@@ -1,3 +1,127 @@
1
1
  動画の操作にハンドルを使いたいんですが、noUiSliderだと動画の再生時間に紐付けると動作がすごく遅くなります
2
2
 
3
3
  こればっかりは自作しかないのでしょうか?
4
+
5
+
6
+
7
+ ```html
8
+
9
+ <div id="form-video">
10
+
11
+ <label for="video">動画を選択</label>
12
+
13
+ <input id="video" type="file" accept="video/*" onchange="{ changed }"></input>
14
+
15
+ <div class="video-wrapper" if={ preview }>
16
+
17
+ <video preload="auto" ref="video" onloadeddata="{ loaded }" ontimeupdate="{ playing }">
18
+
19
+ <source src="{ previewSrc }" type="video/mp4">
20
+
21
+ </video>
22
+
23
+ <div class="controls">
24
+
25
+ <div class="movie-state" onclick="{ clickState }">
26
+
27
+ <i class="fa fa-play click_state" aria-hidden="true"></i>
28
+
29
+ </div>
30
+
31
+ <div class="timeline" ref="timeline"></div>
32
+
33
+ <div class="time">
34
+
35
+ <div class="now-time">{ playTime }</div>
36
+
37
+ <div class="slash">/</div>
38
+
39
+ <div class="all-time">{ totalTime }</div>
40
+
41
+ </div>
42
+
43
+ </div>
44
+
45
+ </div>
46
+
47
+ </div>
48
+
49
+ ```
50
+
51
+ ```javascript
52
+
53
+ this.loaded = function() {
54
+
55
+
56
+
57
+ var totalSecond = Math.floor(this.refs.video.duration)
58
+
59
+ this.playTime = '0:00'
60
+
61
+ this.totalTime = timeFormat(this.refs.video.duration)
62
+
63
+
64
+
65
+
66
+
67
+
68
+
69
+ noUiSlider.create(this.refs.timeline, {
70
+
71
+ start: 0,
72
+
73
+ connect: true,
74
+
75
+ orientation: "horizontal",
76
+
77
+ step: 0.000001,
78
+
79
+ range: {
80
+
81
+ 'min': 0,
82
+
83
+ 'max': totalSecond
84
+
85
+ },
86
+
87
+ format: wNumb({
88
+
89
+ decimals: 0
90
+
91
+ })
92
+
93
+ })
94
+
95
+
96
+
97
+ this.refs.timeline.noUiSlider.on('start', function(e) {
98
+
99
+ tag.refs.video.pause()
100
+
101
+ })
102
+
103
+
104
+
105
+ this.refs.timeline.noUiSlider.on('end', function(e) {
106
+
107
+ if (playState) {
108
+
109
+ tag.refs.video.play()
110
+
111
+ }
112
+
113
+ })
114
+
115
+
116
+
117
+ this.refs.timeline.noUiSlider.on('slide', function(e) {
118
+
119
+ tag.refs.video.currentTime = e[0]
120
+
121
+ })
122
+
123
+
124
+
125
+ }
126
+
127
+ ```