测试版

This commit is contained in:
liuyuan
2025-03-05 15:16:45 +08:00
parent 8dbdce6d3f
commit 9accfddbe5
3849 changed files with 365801 additions and 0 deletions

View File

@@ -0,0 +1,98 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, shrink-to-fit=no">
<title>腾讯云视频点播示例</title>
<!-- 引入播放器 css 文件 -->
<link href="https://web.sdk.cloud.tencent.cn/player/tcplayer/release/v4.5.0/tcplayer.min.css" rel="stylesheet">
<script src="https://imgcache.qq.com/open/qcloud/video/tcplayer/libs/hls.min.0.13.2m.js"></script>
<!-- 引入播放器 js 文件 -->
<script src="https://web.sdk.cloud.tencent.cn/player/tcplayer/release/v4.5.0/tcplayer.v4.5.0.min.js"></script>
<!-- 示例 CSS 样式可自行删除 -->
<style>
html,body{
margin: 0;
padding: 0;
}
.tcplayer {
margin: 0 auto;
}
@media screen and (max-width: 640px) {
#player-container-id {
width: 100%;
height: 270px;
}
}
/* 设置logo在高分屏的显示样式 */
@media only screen and (min-device-pixel-ratio: 2), only screen and (-webkit-min-device-pixel-ratio: 2) {
.tcp-logo-img {
width: 50%;
}
}
/* 自定义案例一通过修改CSS自定义UI */
.tcplayer-theme-custom-ui .vjs-play-progress{
background-color: #ffff00;
}
.tcplayer-theme-custom-ui .vjs-play-control.vjs-playing .vjs-icon-placeholder:before {
color: #ffff00;
}
.tcplayer-theme-custom-ui .vjs-play-control.vjs-ended .vjs-icon-placeholder:before {
color: #ffff00;
}
.tcplayer-theme-custom-ui .vjs-play-control .vjs-icon-placeholder:before {
color: #ffff00;
}
.tcplayer-theme-custom-ui .vjs-volume-panel .vjs-volume-level {
background-color: #ffff00;
}
.tcplayer-theme-custom-ui .vjs-mute-control .vjs-icon-placeholder:before {
color: #ffff00;
}
</style>
</head>
<body>
<!-- 设置播放器容器 -->
<video id="player-container-id" class="tcplayer-theme-custom-ui" preload="auto" width="640" height="360" playsinline webkit-playsinline>
</video>
<!--
注意事项:
* 播放器容器必须为 video 标签
* player-container-id 为播放器容器的ID可自行设置
* 播放器区域的尺寸请按需设置,建议通过 css 进行设置通过css可实现容器自适应等效果
* playsinline webkit-playsinline 这几个属性是为了在标准移动端浏览器不劫持视频播放的情况下实现行内播放,此处仅作示例,请按需使用
* 设置 x5-playsinline 属性会使用 X5 UI 的播放器
-->
<script>
// 自定义案例二:通过修改页面结构自定义 UI
const Button = TCPlayer.getComponent('Button');
const BigPlayButton = TCPlayer.getComponent('BigPlayButton');
BigPlayButton.prototype.createEl = function () {
var el = Button.prototype.createEl.call(this);
let _html = '<button>Play</button>';
el.appendChild(TCPlayer.dom.createEl('div', {
className: 'vjs-button-icon',
innerHTML: _html,
}));
return el;
};
// 自定义案例三:按需设置 Controlbar 上子元素是否显示以及排列次序
var controlBar = TCPlayer.getComponent('controlBar');
controlBar.prototype.options_ = {
children: ['playToggle', 'volumePanel', 'currentTimeDisplay', 'timeDivider', 'durationDisplay', 'progressControl', 'liveDisplay', 'remainingTimeDisplay', 'customControlSpacer', 'playbackRateMenuButton', 'chaptersButton', 'descriptionsButton', 'fullscreenToggle']
}
var player = TCPlayer('player-container-id', { // player-container-id 为播放器容器ID必须与html中一致
fileID: '5285890799710670616', // 请传入需要播放的视频filID 必须
appID: '1400329073', // 请传入点播账号的appID 必须
//其他参数请在开发文档中查看
});
</script>
</body>
</html>