1 Star 0 Fork 38

AITGroup/SkeyeWebPlayer

forked from OpenSKEYE/SkeyeWebPlayer 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
index.html 4.12 KB
一键复制 编辑 原始数据 按行查看 历史
YWL 提交于 2022-08-03 21:32 . 有效期:2022-08-03 至 2022-09-02
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width,initial-scale=1.0,user-scalable=no,maximum-scale=1.0,minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge,IE=IE9">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>SkeyeWebPlayer播放器测试 v2.0.1</title>
<link rel="shortcut icon" href="./favicon.ico">
<link rel="stylesheet" href="./styles/reset.css">
<link rel="stylesheet" href="./static/element-ui/index.css">
<link rel="stylesheet" href="./styles/index.css">
<style>
.play-url-view {
margin-top: 30px;
margin-bottom: 30px;
}
.play-url-item {
display: flex;
align-items: center;
}
.play-url-item + .play-url-item {
margin-top: 10px;
}
.play-url {
width: 100%;
}
.play-btn {
flex-shrink: 0;
margin-left: 10px;
}
</style>
</head>
<body>
<div id="app">
<div class="header-view">
<div class="header-bar">
<div class="container header-group">
<div class="head-title">SkeyeWebPlayer播放器测试 v2.0.1</div>
</div>
</div>
</div>
<section v-cloak class="container">
<div class="doc margin-top">
<a href="https://openskeye.blog.csdn.net/article/details/124581886" target="_blank">
在线使用文档 https://openskeye.blog.csdn.net/article/details/124581886
</a>
</div>
<div class="margin-top"></div>
<!--播放器容器-->
<div id="WebMediaPlayer"></div>
<div class="play-url-view">
<div class="play-url-item" v-for="(item,index) in lists">
<div class="play-url">
<el-input v-model="item.url" size="medium" placeholder="请输入播放地址" clearable></el-input>
</div>
<div class="play-btn">
<el-button type="primary" size="medium" @click="handlePlay(item.url)" :disabled="!item.url">播放</el-button>
</div>
</div>
</div>
</section>
</div>
<!-- [if lt IE 9]>
<script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
<script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<script src="./static/vue.min.js"></script>
<script src="./static/element-ui/index.js"></script>
<script src="./static/SkeyeWebPlayer/SkeyeWebPlayer.js"></script>
<script>
new Vue({
el: '#app',
data() {
return {
lists: [
{url: 'rtsp://192.168.0.111:5555/51010700031310000000/0'},
{url: 'webrtc://192.168.0.111:10001/rtc/34020000001360000000_0200000002'},
{url: 'http://114.116.122.72:18001/flv/live/34020001001110000103_34020001001320000103_0200000103.flv'}
]
}
},
created() {
},
mounted() {
this.$nextTick(() => {
this.initPlayer()
})
},
methods: {
initPlayer() {
// new WebMediaPlayer(url,domId,callback,options)
this.player = new WebMediaPlayer('', `WebMediaPlayer`, this.callbackFunc, {
cbUserPtr: this,
decodeType: 'auto',
height: true
});
},
// 播放器回调方法
callbackFunc(cbType, cbParams) {
if (cbType === 'playbackTime') {
//console.log("当前回放时间: " + cbParams);
} else if (cbType === 'ended') {
console.log("播放结束");
}
console.log("Callback " + cbType + ": " + cbParams);
},
// 播放
handlePlay(url) {
if (this.player) {
this.player.destroy()
this.initPlayer()
this.player.play(url, 1, 0);
}
},
handleClick(type) {
if (type === 'stop') {
this.player.stop()
}
}
}
})
</script>
</body>
</html>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/aitgroup/skeyewebplayer.git
git@gitee.com:aitgroup/skeyewebplayer.git
aitgroup
skeyewebplayer
SkeyeWebPlayer
2.0.1

搜索帮助