forked from alibaba/rax
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PlayerDemo.js
63 lines (58 loc) · 1.31 KB
/
PlayerDemo.js
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
59
60
61
62
63
import {createElement, Component} from 'rax';
import {
View,
Text,
Image,
Link,
TextInput,
Button,
Switch,
Video,
ScrollView,
TouchableWithoutFeedback} from 'rax-components';
import Player from 'rax-player';
import {isWeex} from 'universal-env';
const logger = {
log: content => {
console && console.log(content);
}
};
class PlayerDemo extends Component {
render() {
return (
<View>
<View style={styles.container}>
<Player
ref="video"
style={{
height: 400,
width: 650,
}}
poster="//gw.alicdn.com/tps/TB1m0.aKFXXXXbJXXXXXXXXXXXX-750-300.png" // 封面图片
src="http://cloud.video.taobao.com/play/u/2780279213/p/1/e/6/t/1/d/ld/36255062.mp4" // 视频源地址
controls
startBtn
// autoPlay
hasFullScreen={true}
onVideoFail={logger.log}
onVideoFinish={logger.log}
onVideoPlay={logger.log}
onVideoPause={logger.log}
/>
</View>
</View>
);
}
}
let styles = {
container: {
padding: 20,
borderStyle: 'solid',
borderColor: '#dddddd',
borderWidth: 1,
marginLeft: 20,
marginRight: 20,
marginBottom: 10,
},
};
export default PlayerDemo;