| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- function video_paly(src) {
- var height = 264;
- var width = 640;
-
- __inline('/node_modules/video.js/dist/video.min.js');
- var css = "<style lang='css/text'>" + __inline('/node_modules/video.js/dist/video-js.min.css') + " .video-js .vjs-fullscreen-control { display: none;} </style>";
- var list = src.split(".");
- var videotype = list[list.length-1]
- var html = css + '<video' +
- ' id="my-player"' +
- ' class="video-js"' +
- ' controls' +
- ' preload="auto"' +
- ' width="' + width + '" height="' + height + '"' +
- ' data-setup=\'{}\'>' +
- ' <source src=\'' + src + '\' type="video/'+videotype+'"></source>' +
- ' <p class="vjs-no-js">' +
- ' To view this video please enable JavaScript, and consider upgrading to a' +
- ' web browser that' +
- ' <a href="http://videojs.com/html5-video-support/" target="_blank">' +
- ' supports HTML5 video' +
- ' </a>' +
- ' </p>' +
- '</video>';
- layer.open({
- area: [width + "px", height + "px"],
- type: 1,
- title: false,
- closeBtn: 0,
- shadeClose: true,
- content: html
- });
- var player = videojs('my-player');
- var options = {
- };
- var player = videojs('my-player', options, function onPlayerReady() {
- videojs.log('Your player is ready!');
- // In this context, `this` is the player that was created by Video.js.
- this.play();
- // How about an event listener?
- this.on('ended', function() {
- videojs.log('Awww...over so soon?!');
- });
- });
- }
|