<!DOCTYPE html>
<html lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!-- <meta name="viewport" content="initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0" /> -->
<meta content="width=640,user-scalable=0" name="viewport" />
</script>
<style>
html,
body,
* {
padding: 0;
margin: 0;
}
html,
body {
height: 100%;
}
#wrap,
#player {
height: 100%;
}
</style>
</head>
<body>
<div id="wrap">
<div id="player">
</div>
</div>
<script>
window.console2 = console;
</script>
// youku 的api 会重写console,导致console.log 失效,所以需要在引入youku api 之前备份console 对象
<script type="text/javascript" src="http://player.youku.com/jsapi"></script>
<script>
console.log('console');
console2.log('console2');
function setYKUPlayer(data) {
console.log('setYKUPlayer,data is:', data);
// client_id 和 styleid 可以忽略
var player = new YKU.Player('player', {
styleid: '1',
client_id: '7307ee0273158588',
vid: data,
});
}
// http://v.youku.com/v_show/id_XMTQxMzM2MjA5Mg==_ev_1.html?from=y1.3-idx-uhome-1519-20887.205805-205902.1-1
// 在id_ 后面截取视频id:XMTQxMzM2MjA5Mg==
setYKUPlayer('XMTQxMzM2MjA5Mg==');
</script>
</body>
</html>