Skip to content

Commit d107b5f

Browse files
authored
Merge pull request #1 from afromogli/add-video-element-support
Add video element support
2 parents 85305df + 2ab45fd commit d107b5f

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

src/document.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import {Canvas} from './canvas'
22
import Image from './Image'
33
import {Element} from './element'
4+
import Video from './video';
45

56
const stack = {}
67

@@ -38,6 +39,10 @@ export default {
3839
return new Image()
3940
}
4041

42+
case 'video': {
43+
return new Video();
44+
}
45+
4146
default: {
4247
return new Element()
4348
}

src/video.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
export default function() {
2+
const video = wx.createVideo({width: 0, height: 0, controls: false})
3+
video.canPlayType = () => {
4+
return true;
5+
}
6+
return video
7+
}
8+

0 commit comments

Comments
 (0)