Last active
September 29, 2018 09:34
-
-
Save mraiguo/6786502ece497f17a1874887a89d900e to your computer and use it in GitHub Desktop.
videojs switch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Video.js | HTML5 Video Player</title> | |
<!-- Change URLs to wherever Video.js files will be hosted --> | |
<link href="//vjs.zencdn.net/6.2.5/video-js.css" rel="stylesheet" type="text/css"> | |
<!-- video.js must be in the <head> for older IEs to work. --> | |
<script src="//vjs.zencdn.net/6.2.5/video.js"></script> | |
</head> | |
<body> | |
<video id="my-player" class="video-js vjs-default-skin"></video> | |
</body> | |
<script type="text/javascript"> | |
var options = { | |
autoplay: false, | |
controls: true, | |
width: 300, | |
height: 200, | |
autoplay: true, | |
sources: [ | |
{ | |
src: 'http://os71std62.bkt.clouddn.com/kitteh.mp4', | |
type: 'video/mp4' | |
} | |
] | |
}; | |
var player = videojs('my-player', options, function onPlayerReady() { | |
videojs.log('Your player is ready!'); | |
}); | |
setTimeout(function() { | |
player.src('http://os71std62.bkt.clouddn.com/ocean.mp4') | |
}, 3000) | |
</script> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment