chore: 更新版本至 5.1.5,修复多个问题并增强移动端支持

This commit is contained in:
Harvey Zack committed 2025-01-19 17:34:40 +08:00
1 parent fae71811db
commit c89b9e7871
215 files changed
+2406 -4385

No files matched your search

@@ -1 +1,8 @@
/*! * artplayer-plugin-chromecast.js v2.0.0 * Github:https://github.com/zhw2590582/ArtPlayer * (c) 2017-2024 Harvey Zack * Released under the MIT License. */ !function(e,t,r,n,o){var i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},a="function"==typeof i[n]&&i[n],c=a.cache||{},u="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function s(t,r){if(!c[t]){if(!e[t]){var o="function"==typeof i[n]&&i[n];if(!r&&o)return o(t,!0);if(a)return a(t,!0);if(u&&"string"==typeof t)return u(t);var f=Error("Cannot find module '"+t+"'");throw f.code="MODULE_NOT_FOUND",f}p.resolve=function(r){var n=e[t][1][r];return null!=n?n:r},p.cache={};var l=c[t]=new s.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return c[t].exports;function p(e){var t=p.resolve(e);return!1===t?{}:s(t)}}s.isParcelRequire=!0,s.Module=function(e){this.id=e,this.bundle=s,this.exports={}},s.modules=e,s.cache=c,s.parent=a,s.register=function(t,r){e[t]=[function(e,t){t.exports=r},{}]},Object.defineProperty(s,"root",{get:function(){return i[n]}}),i[n]=s;for(var f=0;f<t.length;f++)s(t[f]);if(r){var l=s(r);"object"==typeof exports&&"undefined"!=typeof module?module.exports=l:"function"==typeof define&&define.amd&&define(function(){return l})}}({ipx5S:[function(e,t,r){var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"default",function(){return a});var o=e("@swc/helpers/_/_async_to_generator"),i=e("@swc/helpers/_/_ts_generator");function a(e){var t;return window.__onGCastApiAvailable=function(e){e&&window.cast.framework.CastContext.getInstance().setOptions({receiverApplicationId:window.chrome.cast.media.DEFAULT_MEDIA_RECEIVER_APP_ID,autoJoinPolicy:window.chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED})},t=(0,o._)(function(t){function r(r){var n=e.url||t.option.url,o=e.mimeType||({mp4:"video/mp4",webm:"video/webm",ogg:"video/ogg",ogv:"video/ogg",mp3:"audio/mp3",wav:"audio/wav",flv:"video/x-flv",mov:"video/quicktime",avi:"video/x-msvideo",wmv:"video/x-ms-wmv",mpd:"application/dash+xml",m3u8:"application/x-mpegURL"})[n.split("?")[0].split("#")[0].split(".").pop().toLowerCase()]||"application/octet-stream",i=new window.chrome.cast.media.MediaInfo(n,o),a=new window.chrome.cast.media.LoadRequest(i);r.loadMedia(a).then(function(){console.log("Media loaded successfully")},function(e){t.notice.show="Error casting media",console.log("Error casting media",e)})}return(0,i._)(this,function(n){switch(n.label){case 0:var o;if(!(!window.chrome||!window.chrome.cast))return[3,2];return[4,(o=e.sdk||"https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1",new Promise(function(e,t){var r=document.createElement("script");r.src=o,r.onload=e,r.onerror=t,document.body.appendChild(r)}))];case 1:n.sent(),n.label=2;case 2:return t.controls.add({name:"chromecast",position:"right",tooltip:"Chromecast",html:'<i class="art-icon art-icon-cast">'.concat(e.icon||'<svg height="20" width="20" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><path d="M512 96H64v99c-13-2-26.4-3-40-3H0V96C0 60.7 28.7 32 64 32H512c35.3 0 64 28.7 64 64V416c0 35.3-28.7 64-64 64H288V456c0-13.6-1-27-3-40H512V96zM24 224c128.1 0 232 103.9 232 232c0 13.3-10.7 24-24 24s-24-10.7-24-24c0-101.6-82.4-184-184-184c-13.3 0-24-10.7-24-24s10.7-24 24-24zm8 192a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM0 344c0-13.3 10.7-24 24-24c75.1 0 136 60.9 136 136c0 13.3-10.7 24-24 24s-24-10.7-24-24c0-48.6-39.4-88-88-88c-13.3 0-24-10.7-24-24z"/></svg>',"</i>"),click:function(){var e=window.cast.framework.CastContext.getInstance().getCurrentSession();e?r(e):window.cast.framework.CastContext.getInstance().requestSession().then(function(e){r(e)},function(e){t.notice.show="Error connecting to cast session",console.log("Error connecting to cast session",e)})}}),[2,{name:"artplayerPluginChromecast"}]}})}),function(e){return t.apply(this,arguments)}}"undefined"!=typeof window&&(window.artplayerPluginChromecast=a)},{"@swc/helpers/_/_async_to_generator":"eONSn","@swc/helpers/_/_ts_generator":"6Xyd0","@parcel/transformer-js/src/esmodule-helpers.js":"iWrD0"}],eONSn:[function(e,t,r){var n=e("@parcel/transformer-js/src/esmodule-helpers.js");function o(e,t,r,n,o,i,a){try{var c=e[i](a),u=c.value}catch(e){r(e);return}c.done?t(u):Promise.resolve(u).then(n,o)}function i(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function c(e){o(a,n,i,c,u,"next",e)}function u(e){o(a,n,i,c,u,"throw",e)}c(void 0)})}}n.defineInteropFlag(r),n.export(r,"_async_to_generator",function(){return i}),n.export(r,"_",function(){return i})},{"@parcel/transformer-js/src/esmodule-helpers.js":"iWrD0"}],iWrD0:[function(e,t,r){r.interopDefault=function(e){return e&&e.__esModule?e:{default:e}},r.defineInteropFlag=function(e){Object.defineProperty(e,"__esModule",{value:!0})},r.exportAll=function(e,t){return Object.keys(e).forEach(function(r){"default"===r|Line truncated
/*!
* artplayer-plugin-chromecast.js v1.0.1
* Github: https://github.com/zhw2590582/ArtPlayer
* (c) 2017-2025 Harvey Zack
* Released under the MIT License.
*/
!function(e,t,r,n,o){var i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},a="function"==typeof i[n]&&i[n],c=a.cache||{},s="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function u(t,r){if(!c[t]){if(!e[t]){var o="function"==typeof i[n]&&i[n];if(!r&&o)return o(t,!0);if(a)return a(t,!0);if(s&&"string"==typeof t)return s(t);var l=Error("Cannot find module '"+t+"'");throw l.code="MODULE_NOT_FOUND",l}p.resolve=function(r){var n=e[t][1][r];return null!=n?n:r},p.cache={};var f=c[t]=new u.Module(t);e[t][0].call(f.exports,p,f,f.exports,this)}return c[t].exports;function p(e){var t=p.resolve(e);return!1===t?{}:u(t)}}u.isParcelRequire=!0,u.Module=function(e){this.id=e,this.bundle=u,this.exports={}},u.modules=e,u.cache=c,u.parent=a,u.register=function(t,r){e[t]=[function(e,t){t.exports=r},{}]},Object.defineProperty(u,"root",{get:function(){return i[n]}}),i[n]=u;for(var l=0;l<t.length;l++)u(t[l]);if(r){var f=u(r);"object"==typeof exports&&"undefined"!=typeof module?module.exports=f:"function"==typeof define&&define.amd&&define(function(){return f})}}({ipx5S:[function(e,t,r){var n=e("@parcel/transformer-js/src/esmodule-helpers.js");n.defineInteropFlag(r),n.export(r,"default",function(){return a});var o=e("@swc/helpers/_/_async_to_generator"),i=e("@swc/helpers/_/_ts_generator");function a(e){var t,r=!1,n=null,a=null,c=function(t,r){var n=e.url||t.option.url,o=new window.chrome.cast.media.MediaInfo(n,e.mimeType||({mp4:"video/mp4",webm:"video/webm",ogg:"video/ogg",ogv:"video/ogg",mp3:"audio/mp3",wav:"audio/wav",flv:"video/x-flv",mov:"video/quicktime",avi:"video/x-msvideo",wmv:"video/x-ms-wmv",mpd:"application/dash+xml",m3u8:"application/x-mpegURL"})[n.split("?")[0].split("#")[0].split(".").pop().toLowerCase()]||"application/octet-stream"),i=new window.chrome.cast.media.LoadRequest(o);r.loadMedia(i).then(function(){var r;t.notice.show="Casting started",null===(r=e.onCastStart)||void 0===r||r.call(e)}).catch(function(r){var n;throw t.notice.show="Error casting media",null===(n=e.onError)||void 0===n||n.call(e,r),r})},s=function(e){var t=document.querySelector(".art-icon-cast");if(t)switch(e){case"connected":t.style.color="red";break;case"connecting":case"disconnecting":t.style.color="orange";break;default:t.style.color="white"}};return t=(0,o._)(function(t){return(0,i._)(this,function(u){return t.controls.add({name:"chromecast",position:"right",tooltip:"Chromecast",html:'<i class="art-icon art-icon-cast">'.concat(e.icon||'<svg height="20" width="20" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><path d="M512 96H64v99c-13-2-26.4-3-40-3H0V96C0 60.7 28.7 32 64 32H512c35.3 0 64 28.7 64 64V416c0 35.3-28.7 64-64 64H288V456c0-13.6-1-27-3-40H512V96zM24 224c128.1 0 232 103.9 232 232c0 13.3-10.7 24-24 24s-24-10.7-24-24c0-101.6-82.4-184-184-184c-13.3 0-24-10.7-24-24s10.7-24 24-24zm8 192a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM0 344c0-13.3 10.7-24 24-24c75.1 0 136 60.9 136 136c0 13.3-10.7 24-24 24s-24-10.7-24-24c0-48.6-39.4-88-88-88c-13.3 0-24-10.7-24-24z"/></svg>',"</i>"),click:/*#__PURE__*/(0,o._)(function(){var o,u,l,f,p;return(0,i._)(this,function(i){switch(i.label){case 0:if(r)return[3,4];i.label=1;case 1:return i.trys.push([1,3,,4]),[4,new Promise(function(t,o){if(window.__onGCastApiAvailable=function(i){if(i){var c=window.cast.framework.CastContext.getInstance();c.setOptions({receiverApplicationId:window.chrome.cast.media.DEFAULT_MEDIA_RECEIVER_APP_ID,autoJoinPolicy:window.chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED}),c.addEventListener(window.cast.framework.CastContextEventType.SESSION_STATE_CHANGED,function(t){var r,o,i,c,u,l=window.cast.framework.SessionState;switch(a=t.sessionState,n=t.session,t.sessionState){case l.NO_SESSION:null===(r=e.onStateChange)||void 0===r||r.call(e,"disconnected"),s("disconnected");break;case l.SESSION_STARTING:null===(o=e.onStateChange)||void 0===o||o.call(e,"connecting"),s("connecting");break;case l.SESSION_STARTED:null===(i=e.onStateChange)||void 0===i||i.call(e,"connected"),s("connected");break;case l.SESSION_ENDING:null===(c=e.onStateChange)||void 0===c||c.call(e,"disconnecting"),s("disconnecting");break;case l.SESSION_RESUMED:null===(u=e.onStateChange)||void 0===u||u.call(e,"connected"),s("connected")}}),c.addEventListener(window.cast.framework.CastContextEventType.CAST_STATE_CHANGED,function(t){var r,n,o,i=window.cast.framework.CastState;switch(t.castState){case i.NO_DEVICES_AVAILABLE:null===(r=e.onCastAvailable)||void 0===r||r.call(e,!1);break;case i.NOT_CONNECTED:null===(n=e.onCastAvailable)||void 0===n||n.call(e,!0);break;case i.CONNECTING:case i.CONNECTED:null===(o=e.onCastAvailable)||void 0===o||o.call(e,!0)}}),r=!0,t()}else o(Error("Cast API is not available"))},!window.chrome||!window.chrome.cast){var i;(i=e.sdk||"https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1",new Promise(function(e,t){var r=document.createElement("scLine truncated