forked from alibaba/rax
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlayerDemo.js
More file actions
61 lines (57 loc) · 1.5 KB
/
Copy pathPlayerDemo.js
File metadata and controls
61 lines (57 loc) · 1.5 KB
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
import {createElement, Component} from 'rax';
import View from 'rax-view';
import Text from 'rax-text';
import Image from 'rax-image';
import Link from 'rax-link';
import TextInput from 'rax-textinput';
import Button from 'rax-button';
import Switch from 'rax-switch';
import Video from 'rax-video';
import ScrollView from 'rax-scrollview';
import TouchableWithoutFeedback from 'rax-touchable';
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;