|
|
|
@ -742,13 +742,22 @@ $(function () {
|
|
|
|
|
window.Motion = newMotion;
|
|
|
|
|
|
|
|
|
|
var motionVideo = {
|
|
|
|
|
video: ['https://t.alipayobjects.com/images/rmsweb/T1yHhhXfxkXXXXXXXX.webm', 'https://t.alipayobjects.com/images/rmsweb/T12I8gXexdXXXXXXXX.webm', 'https://t.alipayobjects.com/images/rmsweb/T1br0gXghtXXXXXXXX.webm', 'https://t.alipayobjects.com/images/rmsweb/T14q0hXbBdXXXXXXXX.webm'],
|
|
|
|
|
videoMp4: ['https://t.alipayobjects.com/images/rmsweb/T15IXhXlXbXXXXXXXX.mp4', 'https://t.alipayobjects.com/images/rmsweb/T1e0hgXcpdXXXXXXXX.mp4', 'https://t.alipayobjects.com/images/rmsweb/T1lcRgXb4gXXXXXXXX.mp4', 'https://t.alipayobjects.com/images/T1qWNhXkpeXXXXXXXX.mp4'],
|
|
|
|
|
init: function () {
|
|
|
|
|
var self = this;
|
|
|
|
|
self.videoBox = $(".video-player");
|
|
|
|
|
$('<video preload loop></video>').appendTo(self.videoBox);
|
|
|
|
|
for (var i = 0; i < self.videoBox.length; i++) {
|
|
|
|
|
var svg = new SVG();
|
|
|
|
|
self.videoBox.eq(i).append(svg.node);
|
|
|
|
|
var video = self.videoBox.eq(i).find("video");
|
|
|
|
|
console.log(video[0].canPlayType('video/webm; codecs="vp8.0, vorbis"'));
|
|
|
|
|
if(video[0].canPlayType('video/webm; codecs="vp8.0, vorbis"')) {
|
|
|
|
|
$('<source src="'+self.video[i]+'" type="video/webm">').appendTo(video);
|
|
|
|
|
}else{
|
|
|
|
|
$('<source src="'+self.videoMp4[i]+'" type="video/mp4">').appendTo(video);
|
|
|
|
|
}
|
|
|
|
|
video.css({"width": "100%"});
|
|
|
|
|
video.append(svg);
|
|
|
|
|
svg.css({"position": "absolute", "top": 0, "left": 0});
|
|
|
|
|