1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
| <!doctype html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>index</title> <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/> <script src="https://cdn.bootcss.com/vue/2.6.6/vue.js"></script> <style> ::-webkit-media-controls{ display:none !important; } </style> </head> <body> <div id="index"> <video ref="video" autoplay="autoplay" muted="muted" v-on:click="full" loop="loop"> <source src="http://vjs.zencdn.net/v/oceans.mp4" type="video/mp4"> </video> </div> </body>
<script type="text/javascript" charset="utf-8"> new Vue({ el: "#index", data: {}, created: function () {
}, methods: { play() { var x = this.$refs.video; if (x.paused) { x.play(); } else { x.pause(); } }, full() { var x = this.$refs.video; if (x.requestFullscreen) { x.requestFullscreen(); } if (x.webkitExitFullScreen) { x.webkitExitFullScreen(); } } } }); </script> </html>
|