|
你试试我的代码吧,我测试的ios版本是13.1.2
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="maximum-scale=1.0, minimum-scale=1.0, user-scalable=0, initial-scale=1.0, width=device-width" />
<meta name="format-detection" content="telephone=no, email=no, date=no, address=no">
<title>Hello APP</title>
<link rel="stylesheet" type="text/css" href="../css/api.css" />
<style>
html,
body {
height: 100%;
}
.wrap {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-flex-flow: column;
}
header {
height: 44px;
width: 100%;
text-align: center;
background-color: #81a9c3;
color: #fff;
line-height: 44px;
font-size: 20px;
}
.flex-1 {
-webkit-box-flex: 1;
-webkit-flex: 1;
}
footer {
height: 30px;
width: 100%;
background-color: #81a9c3;
color: white;
line-height: 30px;
text-align: center;
}
h1 {
padding: 20px;
}
</style>
</head>
<body>
<h1 onclick="fn()">fn</h1>
</body>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript">
apiready = function() {
var moviePlayer = api.require('moviePlayer');
moviePlayer.addEventListener(function(ret){
if(ret && ret.eventType == 'back'){
alert('点击back按钮');
}
});
};
function fn() {
var moviePlayer = api.require('moviePlayer');
alert(moviePlayer)
moviePlayer.open({
rect: {
x: 0,
y: 0,
w: api.frameWidth,
h: 300
},
enterPlayBtn: {
size: 60, // 数字类型;按钮大小;默认:30
iconPath: 'widget://image/back.png' // 字符串类型;图标路径;
},
styles: {
head: {
bg: 'rgba(161,161,161,0.5)',
height: 44,
y: 20,
title: {
size: 20,
color: '#fff',
width: 40,
leftMargin: 10
},
backSize: 30,
backImg: 'widget://image/back.png',
customButtons: [{
w: 30,
h: 30,
rightMagin: 10,
img: 'widget://res/QQ.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://res/QQ.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://res/QQ.png',
horizontalImg: 'widget://res/QQ.png',
}
}
},
path: 'http://**.**2.z0.glb**.**/c1.1.mp4',
autoPlay: false
}, function(ret, err) {
if (ret) {
} else {
alert(JSON.stringify(err));
}
});
}
</script>
</html>
|
|