File tree Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Original file line number Diff line number Diff line change
1
+ <!DOCTYPE html>
2
+ < html lang ="en ">
3
+ < head >
4
+ < meta charset ="UTF-8 ">
5
+ < meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
6
+ < title > Vídeo</ title >
7
+ < style >
8
+ video {
9
+ width : 800px ;
10
+ }
11
+ </ style >
12
+ </ head >
13
+ < body >
14
+ < video src ="exemplo.mp4 " id ="video " preload > </ video >
15
+
16
+
17
+ < script src ="https://code.jquery.com/jquery-3.5.0.min.js "> </ script >
18
+ < script >
19
+ /*JQuery*/
20
+ /*
21
+ var $video = $('#video');
22
+ $video.on('mouseenter focus', function(){
23
+ $video.get(0).play();
24
+ });
25
+ $video.on('mouseout blur', function(){
26
+ $video.get(0).pause();
27
+ });
28
+ */
29
+
30
+ /*Javascript*/
31
+ var video = document . getElementById ( 'video' )
32
+ video . addEventListener ( 'mouseover' , function ( ) {
33
+ video . play ( )
34
+ } , false ) ;
35
+
36
+ video . addEventListener ( 'mouseout' , function ( ) {
37
+ video . pause ( )
38
+ } , false ) ;
39
+ </ script >
40
+ </ body >
41
+ </ html >
You can’t perform that action at this time.
0 commit comments