File tree Expand file tree Collapse file tree 1 file changed +6
-26
lines changed
Expand file tree Collapse file tree 1 file changed +6
-26
lines changed Original file line number Diff line number Diff line change @@ -25,33 +25,13 @@ function setupPlayer(video) {
2525 container . appendChild ( video ) ;
2626 container . appendChild ( icon ) ;
2727
28- const feature = video . closest ( '.feature-grid li' ) ;
29-
30- if ( feature != null ) {
31- video . removeAttribute ( 'loop' ) ;
32- video . loop = false ;
33-
34- feature . addEventListener ( 'mouseenter' , ( ) => {
35- video . removeEventListener ( 'ended' , pause ) ;
36- video . loop = true ;
37-
28+ container . addEventListener ( 'click' , ( ) => {
29+ if ( video . paused ) {
3830 play ( ) ;
39- } ) ;
40-
41- feature . addEventListener ( 'mouseleave' , ( ) => {
42- video . loop = false ;
43-
44- video . addEventListener ( 'ended' , pause , { once : true } ) ;
45- } ) ;
46- } else {
47- container . addEventListener ( 'click' , ( ) => {
48- if ( video . paused ) {
49- play ( ) ;
50- } else {
51- pause ( ) ;
52- }
53- } ) ;
54- }
31+ } else {
32+ pause ( ) ;
33+ }
34+ } ) ;
5535
5636 container . style . borderRadius = window . getComputedStyle ( video ) . borderRadius ;
5737
You can’t perform that action at this time.
0 commit comments