插件介紹
安卓YYEVAPlayer MP4禮物播放器原生插件,是一個輕量的動畫渲染庫,使用Native Opengles 渲染視頻,為你提供高性能、低開銷的動畫體驗
對比傳統的序列幀的動畫播放方式,具有更高的壓縮率,硬解碼效率更高的優點,同時支持插入動態的業務元素;對比SVGA、Lottie等播放器,支持更多的特效支持,如復雜3D效果、描邊、粒子效果等,達到所見即所得的效果。
本插件是根據github開源代碼https://github.com/yylive/YYEVA開發,詳情請參考github
插件地址
安卓YYEVAPlayer MP4禮物播放器原生插件 - DCloud 插件市場
詳細使用文檔?
uniapp安卓YYEVAPlayer MP4禮物播放器原生插件
超級福利
?uniapp leven系列插件購買超級福利
用法
?在需要使用插件的頁面加載以下代碼
<leven-yyevaPlayer ref="refLevenYyevaPlayer" style="flex:1; height: 300px;" @onDownloadStart="onDownloadStart" @onDownloading="onDownloading"@onDownloadComplete="onDownloadComplete" @onDownloadError="onDownloadError" @onVideoStart="onVideoStart" @onVideoRestart="onVideoRestart"@onVideoComplete="onVideoComplete" @onVideoDestroy="onVideoDestroy" @onVideoError="onVideoError"></leven-yyevaPlayer>
頁面內容
<template><view><uni-card title="uniapp安卓YYEVAPlayer MP4禮物播放器原生插件"><leven-yyevaPlayer ref="refLevenYyevaPlayer" style="flex:1; height: 300px;" @onDownloadStart="onDownloadStart" @onDownloading="onDownloading"@onDownloadComplete="onDownloadComplete" @onDownloadError="onDownloadError" @onVideoStart="onVideoStart" @onVideoRestart="onVideoRestart"@onVideoComplete="onVideoComplete" @onVideoDestroy="onVideoDestroy" @onVideoError="onVideoError"></leven-yyevaPlayer><button type="primary" @click="play">開始播放</button><button type="primary" @click="stop">停止播放</button><button type="primary" @click="logStr = ''">清空日志</button></uni-card><uni-card class="uni-card-box" title="日志"><view><text style="font-size: 14px; flex-wrap: wrap;">{{logStr}}</text></view></uni-card></view>
</template><script>export default {data() {return {logStr: ""}},methods: {// 開始播放play() {if (this.$refs.refLevenYyevaPlayer) {this.$refs.refLevenYyevaPlayer.play({url: "http://lxcode.bs2cdn.yy.com/084e52e9-fd58-4967-ba8b-cd3c4d6c1849.mp4"}, res => {this.writeLog(JSON.stringify(res))})}},// 停止播放stop() {if (this.$refs.refLevenYyevaPlayer) {this.$refs.refLevenYyevaPlayer.stop(res => {this.writeLog(JSON.stringify(res))})}},// 網絡地址開始下載onDownloadStart(e) {this.writeLog("onDownloadStart:" + JSON.stringify(e))},// 網絡地址下載中onDownloading(e) {this.writeLog("onDownloading:" + JSON.stringify(e))},// 網絡地址下載完成onDownloadComplete(e) {this.writeLog("onDownloadComplete:" + JSON.stringify(e))},// 網絡地址下載出錯onDownloadError(e) {this.writeLog("onDownloadError:" + JSON.stringify(e))},// 視頻開始播放onVideoStart(e) {this.writeLog("onVideoStart:" + JSON.stringify(e))},// 視頻重復播放onVideoRestart(e) {this.writeLog("onVideoRestart:" + JSON.stringify(e))},// 視頻播放結束onVideoComplete(e) {this.writeLog("onVideoComplete:" + JSON.stringify(e))},// 播放器被銷毀onVideoDestroy(e) {this.writeLog("onVideoDestroy:" + JSON.stringify(e))},// 播放出錯onVideoError(e) {this.writeLog("onVideoError:" + JSON.stringify(e))},// 寫日志writeLog(str) {let logStr = uni.$lv.date.format(null, "yyyy-mm-dd hh:MM:ss") + " " + str + "\n";this.logStr = logStr + this.logStr;}}}
</script><style></style>
插件方法
- 開始播放
- 停止播放
插件事件
- ?網絡地址開始下載
- 網絡地址下載中
- 網絡地址下載完成
- 網絡地址下載出錯
- 視頻開始播放
- 視頻重復播放
- 視頻播放結束
- 播放器被銷毀
- 播放出錯
聯系作者
?購買插件前請先試用,試用通過再購買。在試用中如果遇到任何問題,可與作者聯系,QQ:334106817,將全力協助你使用本插件
圖片預覽
相關文檔介紹
-
第一篇:直播間禮物動效 - 實現方案
-
第二篇:透明MP4禮物
-
第三篇:變換矩陣在動畫上一些應用
-
第四篇?, 讓MP4靜態資源也能夠動態起來
-
第五篇設計規范
-
第六篇數據結構
YYEVA視頻教程
- 視頻1相關工具安裝
- 視頻2環境搭建
- 視頻3:YYEVA-如何創建一個mask合成
- 視頻4:YYEVA-制作mask_text
- 視頻5:YYEVA-制作mask_image
- 視頻6:YYEVA-如何安裝或更新CEP插件