The correct way to open the Alibaba Cloud Player SDK | Aliplayer Web Player Introduction and Function Implementation (3)

Player Architecture Player functions Recently, we have also implemented screenshots, internationalization, variable speed, UI customization, WeChat same-layer playback, adaptive playback, encrypted playback, H5 playback flv, custom plug-ins and other functions on the player side. In the future, we will also implement functions such as bullet screens and advertisements in the form of plug-ins, which will be open sourced to github, and will also support users to customize the SDK package according to their own business needs. The player supports video format adaptation and playback. The basic principle of our entire video playback is H5 priority, and those that can be played in H5 will definitely not need Flash to play. So on the mobile side, we definitely use H5 to play, and the PC side also uses H5 as much as possible according to this principle. At the same time, we will determine which playback format the browser type supports. For example, m3u8 can only be played in browsers above IE11 on the PC side. If we encounter browsers below IE11, we will automatically choose Flash to play. In terms of video format, assuming the video is rtmp and flv, we will automatically select Flash for playback. In addition, if the user sets the useH5Prism and useFlashPrism attributes independently, then we will also follow the user's choice. The browser supports two playback methods: source, play through url and play through on-demand vid+playauth. The second method is more closely combined with video cloud. On-demand playback format selection There are many video formats generated by transcoding in the on-demand service, including m3u8 , flv, mp4, etc. The player has its own set of logic to select the playback format. For H5, the low-definition version is played by default to save traffic. If the user uses the function of switching the definition, then we will open the version he chooses by default. In terms of format, mp4 is played by default, and users can also set qualitySort to play the high-definition version first. For Flash, the default format order is m3u8, flv, mp4. 2. Function introduction and enable the creation of the player. Reference the correct JS and CSS files. Adding the player container requires setting the id attribute of the container. In addition, 2.0. Versions before 1 will add the prism-player type. New Aliplayer creates a playback online configuration, users can experience the situation of the player beforehand Similarly, for vid+playauth playback, you need to destroy the player first, and then recreate the playback. Switching between different address formats can only destroy the player first, and then re-select the correct player to play. Github address to see the simple demo: https://github.com/alilmq/aliplayer-simple-demo![b_3_7] UI custom screenshot H5 enabled: Supports setting the size and quality of the screenshot: While changing the broadcast function, the broadcast is MTS function, the player can support the playback of this scenario. When you watch for the first time, call the MTS API to start transcoding, play while transcoding, and you can set delayed playback. The live player is used in transcoding, and the on-demand mode is used to play after transcoding. H5 android WeChat same-layer playback also requires a live broadcast scene, and the video needs to be full screen. Peer playback can be enabled by setting x5_type:h5. Demo address: https://github. com/alilmq/h5livedemo provides language attribute for internationalization, which is used to enable various languages, the default is zh-cn, and the optional value is zh-cn or en-us. When the playback fails, it will try to replay and trigger the onM3u8Retry event. Some reminders can be made in the event, such as the host leaving, please wait a moment; if it fails after several attempts, the livestreamstop event will be triggered. Here are some hints that the live broadcast fails or ends. 3. Other auxiliary functions and tools We have also made some auxiliary tools to facilitate users to access and troubleshoot problems. Diagnostic Tool Detection Tool Regarding video playback failure, we provide three methods, native H5, Alibaba Cloud H5, and Alibaba Cloud Flash. We call up the playback log, and judge the reason for the playback failure through the log. For example, if the user fails when they first request data, then we will guess that there is an authentication failure; if there is an error in loading the data, it may be the user's network; if it is an error after starting playback, it may be the problem. It's in parsing or the player does not support it. ffmpeg to view video information Finally, all the information of Alibaba Cloud Player is aggregated on the following website: http://player.alicdn.com/detection.html, including help documents, online configuration, diagnostic tools, product demos, etc. You can log in for details. [/align] This article is the original content of the Yunqi community and cannot be reproduced without permission. If you need to reprint, please send an email to [email protected]; if you find any content suspected of plagiarism in this community, please send an email To: [email protected] to report and provide relevant evidence, once verified, the community will immediately delete the allegedly infringing content. html, including help documents, online configuration, diagnostic tools, product demos, etc. You can log in for details. [/align] This article is the original content of the Yunqi community and cannot be reproduced without permission. If you need to reprint, please send an email to [email protected]; if you find any content suspected of plagiarism in this community, please send an email To: [email protected] to report and provide relevant evidence, once verified, the community will immediately delete the allegedly infringing content. html, including help documents, online configuration, diagnostic tools, product demos, etc. You can log in for details. [/align] This article is the original content of the Yunqi community and cannot be reproduced without permission. If you need to reprint, please send an email to [email protected]; if you find any content suspected of plagiarism in this community, please send an email To: [email protected] to report and provide relevant evidence, once verified, the community will immediately delete the allegedly infringing content.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326112057&siteId=291194637