File tree 1 file changed +3
-6
lines changed
1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change 1
1
//click view play and pause
2
2
function switchPlayAndPause ( ) {
3
- const ctrl = document . querySelector ( '.player__button[title="Toggle Play"]' ) ;
4
-
5
3
if ( video_application . paused ) {
6
4
video_application . play ( ) ;
7
- ctrl . textContent = '>' ;
8
5
}
9
6
else {
10
7
video_application . pause ( ) ;
11
- ctrl . textContent = '||' ;
12
8
}
13
9
}
14
10
const video_application = document . querySelector ( '.player__video' ) ;
@@ -20,11 +16,12 @@ play_or_pause_ctrl.addEventListener('click', switchPlayAndPause);
20
16
21
17
//video event update icon
22
18
function updateIcon ( ) {
19
+ const ctrl = document . querySelector ( '.player__button[title="Toggle Play"]' ) ;
23
20
if ( video_application . paused ) {
24
- this . textContent = '>' ;
21
+ ctrl . textContent = '>' ;
25
22
}
26
23
else {
27
- this . textContent = '||' ;
24
+ ctrl . textContent = '||' ;
28
25
}
29
26
}
30
27
video_application . addEventListener ( 'play' , updateIcon ) ;
You can’t perform that action at this time.
0 commit comments