阿里oss的播放器 代码
时间: 2024-04-26 21:27:13 浏览: 5
以下是使用阿里OSS自研的HTML5播放器代码示例:
```html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>阿里OSS HTML5播放器示例</title>
<style>
#player {
width: 640px;
height: 360px;
margin: 0 auto;
}
</style>
</head>
<body>
<div id="player"></div>
<script src="//g.alicdn.com/de/prismplayer/2.9.3/aliplayer-min.js"></script>
<script>
var player = new Aliplayer({
id: 'player',
source: 'http://your-bucket.oss-cn-hangzhou.aliyuncs.com/your-video.mp4',
autoplay: true,
width: '100%',
height: '100%',
controlBarVisibility: 'hover',
useH5Prism: true
});
</script>
</body>
</html>
```
其中,`id`为播放器容器的ID,`source`为视频的URL地址,`autoplay`为是否自动播放,`width`和`height`为播放器的宽度和高度,`controlBarVisibility`为控制栏的显示方式,`useH5Prism`为是否使用H5播放器。你需要将`source`替换成你自己的视频URL地址才能播放。