|
代码:
- //打开视频
- function fnOpenVideo() {
- var moviePlayer = api.require('moviePlayer');
- moviePlayer.open({
- rect: {
- x: 0,
- y: 0,
- w: api.frameWidth,
- h: 274
- },
- styles: {
- head: {
- bg: 'rgba(0,0,0,0)',
- height: 30,
- y: api.safeArea.top,
- title: {
- size: 15,
- color: '#fff',
- width: 40,
- leftMargin: 10
- },
- backSize: 20,
- backImg: 'widget://image/back.png',
- customButtons: [{
- w: 30,
- h: 30,
- rightMagin: 10,
- img: 'widget://image/image/collect.png',
- imgSelected: 'fs://image/collectSelected.png',
- }]
- },
- foot: {
- bg: 'rgba(0,0,0,0.5)',
- height: 44,
- palyBtn: {
- size: 20,
- playImg: 'widget://image/play.png',
- pauseImg: 'widget://image/pause.png',
- marginLeft: 5
- },
- currentTimeLabel: {
- textSize: 14,
- textColor: "#FFF",
- textWidth: 43,
- marginLeft: 5
- },
- seekBar: {
- sliderImg: 'widget://image/circle.png',
- sliderW: 20,
- sliderH: 20,
- progressColor: '#696969',
- progressSelected: '#76EE00',
- marginLeft: 10,
- marginRight: 10
- },
- totalTimeLabel: {
- textSize: 14,
- textColor: "#FFF",
- textWidth: 43,
- marginRight: 5
- },
- fullscreenBtn: {
- size: 20,
- verticalImg: 'widget://image/vertical.png',
- horizontalImg: 'widget://image/horizontal.png',
- }
- }
- },
- texts: {
- title: '足球'
- },
- isShowStatusBar: true,
- autorotation: false,
- useGestureControl: false,
- showBack: true,
- coverImg: 'widget://temp/pic1.png',
- path: 'http://**.**2.z0.glb**.**/c1.1.mp4',
- autoPlay: false,
- fixedOn: api.frameName,
- fixed: false,
- }, function(ret, err) {
- if (ret) {
- // alert(JSON.stringify(ret));
- // } else {
- // alert(JSON.stringify(err));
- }
- });
- moviePlayer.addEventListener(function(ret) {
- console.log(JSON.stringify(ret))
- if (ret && ret.eventType == 'back') {
- api.closeWin();
- }
- });
- }
复制代码 |
|