<video>
tag of HTML5 and Flash for video playback. It offers a uniform video playback experience across different platforms when browsers do not natively support video playback. In conjunction with Tencent's Video on Demand service, it provides hotlink protection and features for playing standard encrypted HLS videos.Audio/Video Protocol | Use | URL Format | PC Browser | Mobile Browser |
MP3 | Audio | http://xxx.vod.myqcloud.com/xxx.mp3 | Supported | Supported |
MP4 | VOD playback | http://xxx.vod.myqcloud.com/xxx.mp4 | Supported | Supported |
HLS(M3U8) | Live stream | http://xxx.liveplay.myqcloud.com/xxx.m3u8 | Supported | Supported |
| VOD playback | http://xxx.vod.myqcloud.com/xxx.m3u8 | Supported | Supported |
FLV | Live stream | http://xxx.liveplay.myqcloud.com/xxx.flv | Supported | Partially supported |
| VOD playback | http://xxx.vod.myqcloud.com/xxx.flv | Supported | Partially supported |
WebRTC | Live stream | webrtc://xxx.liveplay.myqcloud.com/live/xxx | Supported | Supported |
Feature\\Browser | Chrome | Firefox | Edge | QQ Browser | Mac Safari | iOS Safari | WeChat | Android Chrome | IE 11 |
Player dimension configuration | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Resuming playback | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Playback speed change | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Preview thumbnails | ✓ | ✓ | ✓ | ✓ | - | - | - | - | ✓ |
Changing `fileID` for playback | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Flipping videos | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Progress bar marking | ✓ | ✓ | ✓ | ✓ | ✓ | - | - | - | ✓ |
HLS adaptive bitrate | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Referer hotlink protection | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | - | ✓ |
Definition change notifications | ✓ | ✓ | ✓ | ✓ | - | - | - | ✓ | ✓ |
Preview | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Playing HLS videos encrypted using standard schemes | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Playing HLS videos encrypted using private protocols | ✓ | ✓ | ✓ | - | - | - | Android:✓ iOS: - | ✓ | ✓ |
Video statistics | ✓ | ✓ | ✓ | ✓ | - | - | - | - | - |
Video data monitoring | ✓ | ✓ | ✓ | ✓ | - | - | - | - | - |
Custom UI messages | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Custom UI | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
On-screen comments | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Watermark | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Ghost watermark | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Playlist | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Frame sync under poor network conditions | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
hls.js
to play HLS.TCPlayer feature | Feature Scope | Required License | Pricing | Authorization Unit |
Basic Functions | Web Player Basic Version License | 0 CNY | An exact domain (1 License can authorize up to 10 exact domains) | |
Premium Functions | Web Player Premium Version License | Wildcard Domain (1 License can authorize up to 1 wildcard domain) |
aaa.xxx.ccc
, import the player style and script files at the appropriate places. When deploying on your own, you need to manually reference the dependency files under the libs folder of the resource package, otherwise, the Tencent Cloud CDN files will be requested by default.<link href="aaa.xxx.ccc/tcplayer.min.css" rel="stylesheet"/><!--To play HLS format videos in modern browsers like Chrome and Firefox through H5, hls.min.x.xx.m.js must be included before tcplayer.vx.x.x.min.js.--><script src="aaa.xxx.ccc/libs/hls.min.x.xx.m.js"></script><!--Player script file--><script src="aaa.xxx.ccc/tcplayer.vx.x.x.min.js"></script>
npm install tcplayer.js
import TCPlayer from 'tcplayer.js';import 'tcplayer.js/dist/tcplayer.min.css';
<video id="player-container-id" width="414" height="270" preload="auto" playsinline webkit-playsinline></video>
<video>
tag.player-container-id
is the ID of the player container, which you can set yourself.preload
attribute in the example specifies whether to load the video after the page is loaded. It is usually set to auto
for faster video playback. Other options are: meta
(to only load metadata after the page loads) and none
(to not load the video after the page loads). Videos will not automatically load on mobile devices due to system restrictions.playsinline
and webkit-playsinline
are used to achieve inline playback in standard mobile browsers without hijacking video playback. This is just an example, please use as needed.x5-playsinline
attribute in the TBS kernel will utilize the X5 UI player.// `player-container-id` is the player container ID, which must be the same as in HTMLvar player = TCPlayer('player-container-id', {sources: [{src: 'Please replace with your playback URL',}],licenseUrl: 'Please replace with your licenseUrl', // License URL, see the preparation section. You can obtain the licenseUrl after applying for a license in the RT-Cube consolelanguage: 'Please replace with your Setting language', // Setting language en | zh-CN});// player.src(url); // URL playback address
var player = TCPlayer('player-container-id', { // player-container-id is the player container ID, which must be the same as that in HTMLfileID: 'Please enter your fileID', // Enter the fileID of the video to be playedappID: 'Please enter your appID', // Enter the appID of your VOD account// Enter the player Signature psign, for information on the Signature and how to generate it see the link: https://www.tencentcloud.com/document/product/266/42436?from_cn_redirect=1psign: 'Please enter your player Signature psign',licenseUrl: 'Please enter your licenseUrl', // Refer to the preparation section. You can obtain the licenseUrl after applying for a license in the RT-Cube consolelanguage: 'Please replace with your Setting language', // Setting language en | zh-CN});
この記事はお役に立ちましたか?