前言
这个视频直播出了一个系列,以下文章是几个播放器的使用教程
- 【视频直播篇一】入门篇
- 【视频直播篇二】vue-cli3集成LivePlayer
- 【视频直播篇三】vue-cli3集成vue-video-player
- 【视频直播篇四】vue-cli3集成flv.js
- 【视频直播篇五】vue-cli3集成vue-aliplayer-v2
- 【视频直播篇六】videojs的使用
正文
可以直接去Aliplayer
的官网看在线配置代码
http://player.alicdn.com/aliplayer/setting/setting.html
具体代码如下:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="IE=edge" >
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"/>
<title>Aliplayer Online Settings</title>
<link rel="stylesheet" href="https://g.alicdn.com/de/prismplayer/2.9.3/skins/default/aliplayer-min.css" />
<script type="text/javascript" charset="utf-8" src="https://g.alicdn.com/de/prismplayer/2.9.3/aliplayer-min.js"></script>
<style type="text/css">
body {
margin: 0 !important;
padding: 0 !important;
}
</style>
</head>
<body>
<div class="prism-player" id="player-con"></div>
<script>
var player = new Aliplayer({
"id": "player-con",
"source": "rtmp://58.200.131.2:1935/livetv/hunantv",
"width": "100%",
"height": "500px",
"autoplay": true,
"isLive": false,
"rePlay": false,
"playsinline": true,
"preload": true,
"controlBarVisibility": "hover",
"useH5Prism": true
}, function (player) {
console.log("The player is created");
}
);
</script>
</body>