vue-player-audio
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -1,1 +0,1 @@ | ||
"use strict";var script={props:{audioSrc:{type:String,required:!0},startSecond:{type:Number,default:0},endSecond:{type:Number,default:0},autoplay:{type:Boolean,default:!1},loop:{type:Boolean,default:!1},loopGapMillisecond:{type:Number,default:50},controls:{type:Boolean,default:!1},preload:{type:String,default:"metadata"}},data:function(){return{isPlaying:!1,currentSecond:this.startSecond,maxSecond:0,setTimeoutId:0,allowSetCurrentTime:!0}},watch:{audioSrc:function(){this.beginPlay()},startSecond:function(){this.beginPlay()}},mounted:function(){this.beginPlay()},beforeDestroy:function(){clearTimeout(this.setTimeoutId)},methods:{beginPlay:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.audioSrc;e&&(this.$refs.audioDom.currentTime=Math.max(this.startSecond,1e-6),this.autoplay&&this.$refs.audioDom.play())},loopPlayOrEndPause:function(){var e=this;this.loop?(this.$refs.audioDom.currentTime=this.startSecond,setTimeout((function(){e.$refs.audioDom.play()}),this.loopGapMillisecond)):(this.$refs.audioDom.pause(),this.$refs.audioDom.currentTime=this.startSecond)},setIsPlaying:function(){var e=this;clearTimeout(this.setTimeoutId),this.setTimeoutId=setTimeout((function(){e.isPlaying=!e.$refs.audioDom.paused}),this.loopGapMillisecond+20)},timeupdateHandler:function(){var e=this;this.maxSecond=this.$refs.audioDom.duration,this.currentSecond=this.$refs.audioDom.currentTime,this.currentSecond<this.startSecond?this.allowSetCurrentTime&&(this.$refs.audioDom.currentTime=this.startSecond,this.allowSetCurrentTime=!1,setTimeout((function(){e.allowSetCurrentTime=!0}),1e3)):((0!==this.endSecond&&this.currentSecond>=this.endSecond||0!==this.maxSecond&&this.currentSecond>=this.maxSecond)&&this.loopPlayOrEndPause(),this.setIsPlaying())},endedHandler:function(){this.loopPlayOrEndPause()},pauseHandler:function(){this.setIsPlaying()}}};function normalizeComponent(e,t,n,o,i,r,s,a,d,u){"boolean"!=typeof s&&(d=a,a=s,s=!1);var _,c="function"==typeof n?n.options:n;if(e&&e.render&&(c.render=e.render,c.staticRenderFns=e.staticRenderFns,c._compiled=!0,i&&(c.functional=!0)),o&&(c._scopeId=o),r?(_=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),t&&t.call(this,d(e)),e&&e._registeredComponents&&e._registeredComponents.add(r)},c._ssrRegister=_):t&&(_=s?function(){t.call(this,u(this.$root.$options.shadowRoot))}:function(e){t.call(this,a(e))}),_)if(c.functional){var l=c.render;c.render=function(e,t){return _.call(t),l(e,t)}}else{var p=c.beforeCreate;c.beforeCreate=p?[].concat(p,_):[_]}return n}var normalizeComponent_1=normalizeComponent;const __vue_script__=script;var __vue_render__=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("span",[n("audio",{ref:"audioDom",attrs:{src:e.audioSrc,controls:e.controls,preload:e.preload},on:{timeupdate:e.timeupdateHandler,ended:e.endedHandler,pause:e.pauseHandler}}),e._v(" "),e._t("default",[n("br"),e._v("\n 正在播放:"+e._s(e.isPlaying)+"\n "),n("br"),e._v("\n 当前时间:"+e._s(e.currentSecond)+"\n "),n("br"),e._v("\n 最大时间:"+e._s(e.maxSecond)+"\n "),n("br")],{isPlaying:e.isPlaying,currentSecond:e.currentSecond,maxSecond:e.maxSecond})],2)},__vue_staticRenderFns__=[];__vue_render__._withStripped=!0;const __vue_inject_styles__=void 0,__vue_scope_id__=void 0,__vue_module_identifier__=void 0,__vue_is_functional_template__=!1,__vue_component__=normalizeComponent_1({render:__vue_render__,staticRenderFns:__vue_staticRenderFns__},void 0,__vue_script__,void 0,!1,void 0,!1,void 0,void 0,void 0);__vue_component__.install=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.component(t.component||"vue-player-audio",__vue_component__)},module.exports=__vue_component__; | ||
"use strict";function e(e,t,o,n,i,s,r,a,d,u){"boolean"!=typeof r&&(d=a,a=r,r=!1);const c="function"==typeof o?o.options:o;let l;if(e&&e.render&&(c.render=e.render,c.staticRenderFns=e.staticRenderFns,c._compiled=!0,i&&(c.functional=!0)),n&&(c._scopeId=n),s?(l=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),t&&t.call(this,d(e)),e&&e._registeredComponents&&e._registeredComponents.add(s)},c._ssrRegister=l):t&&(l=r?function(e){t.call(this,u(e,this.$root.$options.shadowRoot))}:function(e){t.call(this,a(e))}),l)if(c.functional){const e=c.render;c.render=function(t,o){return l.call(o),e(t,o)}}else{const e=c.beforeCreate;c.beforeCreate=e?[].concat(e,l):[l]}return o}const t={props:{audioSrc:{type:String,required:!0},startSecond:{type:Number,default:0},endSecond:{type:Number,default:0},autoplay:{type:Boolean,default:!1},loop:{type:Boolean,default:!1},loopGapMillisecond:{type:Number,default:50},controls:{type:Boolean,default:!1},preload:{type:String,default:"metadata"}},data:function(){return{isPlaying:!1,currentSecond:this.startSecond,maxSecond:0,allowSetCurrentTime:!0,setTimeoutId1:0,setTimeoutId2:0,setTimeoutId3:0}},watch:{audioSrc:function(){this.beginPlay()},startSecond:function(){this.beginPlay()}},mounted:function(){this.beginPlay()},beforeDestroy:function(){clearTimeout(this.setTimeoutId1),clearTimeout(this.setTimeoutId2),clearTimeout(this.setTimeoutId3)},methods:{beginPlay:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.audioSrc;e&&(this.$refs.audioDom.currentTime=Math.max(this.startSecond,1e-6),this.autoplay&&this.$refs.audioDom.play())},loopPlayOrEndPause:function(){var e=this;this.loop?(this.$refs.audioDom.currentTime=this.startSecond,this.setTimeoutId2=setTimeout((function(){try{e.$refs.audioDom.play()}catch(e){}}),this.loopGapMillisecond)):(this.$refs.audioDom.pause(),this.$refs.audioDom.currentTime=this.startSecond)},setIsPlaying:function(){var e=this;clearTimeout(this.setTimeoutId1),this.setTimeoutId1=setTimeout((function(){try{e.isPlaying=!e.$refs.audioDom.paused}catch(e){}}),this.loopGapMillisecond+20)},timeupdateHandler:function(){var e=this;try{this.maxSecond=this.$refs.audioDom.duration,this.currentSecond=this.$refs.audioDom.currentTime,this.currentSecond<this.startSecond?this.allowSetCurrentTime&&(this.$refs.audioDom.currentTime=this.startSecond,this.allowSetCurrentTime=!1,this.setTimeoutId3=setTimeout((function(){e.allowSetCurrentTime=!0}),1e3)):((0!==this.endSecond&&this.currentSecond>=this.endSecond||0!==this.maxSecond&&this.currentSecond>=this.maxSecond)&&this.loopPlayOrEndPause(),this.setIsPlaying())}catch(e){}},endedHandler:function(){try{this.loopPlayOrEndPause()}catch(e){}},pauseHandler:function(){this.setIsPlaying()}}};var o=function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("span",[o("audio",{ref:"audioDom",attrs:{src:e.audioSrc,controls:e.controls,preload:e.preload},on:{timeupdate:e.timeupdateHandler,ended:e.endedHandler,pause:e.pauseHandler}}),e._v(" "),e._t("default",[o("br"),e._v("\n 正在播放:"+e._s(e.isPlaying)+"\n "),o("br"),e._v("\n 当前时间:"+e._s(e.currentSecond)+"\n "),o("br"),e._v("\n 最大时间:"+e._s(e.maxSecond)+"\n "),o("br")],{isPlaying:e.isPlaying,currentSecond:e.currentSecond,maxSecond:e.maxSecond})],2)};o._withStripped=!0;const n=e({render:o,staticRenderFns:[]},void 0,t,void 0,!1,void 0,!1,void 0,void 0,void 0);n.install=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.component(t.component||"vue-player-audio",n)},module.exports=n; |
@@ -1,1 +0,1 @@ | ||
var e=function(e,t,n,o,i,r,s,a,d,u){"boolean"!=typeof s&&(d=a,a=s,s=!1);var c,l="function"==typeof n?n.options:n;if(e&&e.render&&(l.render=e.render,l.staticRenderFns=e.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),o&&(l._scopeId=o),r?(c=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),t&&t.call(this,d(e)),e&&e._registeredComponents&&e._registeredComponents.add(r)},l._ssrRegister=c):t&&(c=s?function(){t.call(this,u(this.$root.$options.shadowRoot))}:function(e){t.call(this,a(e))}),c)if(l.functional){var h=l.render;l.render=function(e,t){return c.call(t),h(e,t)}}else{var p=l.beforeCreate;l.beforeCreate=p?[].concat(p,c):[c]}return n};const t={props:{audioSrc:{type:String,required:!0},startSecond:{type:Number,default:0},endSecond:{type:Number,default:0},autoplay:{type:Boolean,default:!1},loop:{type:Boolean,default:!1},loopGapMillisecond:{type:Number,default:50},controls:{type:Boolean,default:!1},preload:{type:String,default:"metadata"}},data:function(){return{isPlaying:!1,currentSecond:this.startSecond,maxSecond:0,setTimeoutId:0,allowSetCurrentTime:!0}},watch:{audioSrc:function(){this.beginPlay()},startSecond:function(){this.beginPlay()}},mounted:function(){this.beginPlay()},beforeDestroy:function(){clearTimeout(this.setTimeoutId)},methods:{beginPlay:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.audioSrc;e&&(this.$refs.audioDom.currentTime=Math.max(this.startSecond,1e-6),this.autoplay&&this.$refs.audioDom.play())},loopPlayOrEndPause:function(){var e=this;this.loop?(this.$refs.audioDom.currentTime=this.startSecond,setTimeout((function(){e.$refs.audioDom.play()}),this.loopGapMillisecond)):(this.$refs.audioDom.pause(),this.$refs.audioDom.currentTime=this.startSecond)},setIsPlaying:function(){var e=this;clearTimeout(this.setTimeoutId),this.setTimeoutId=setTimeout((function(){e.isPlaying=!e.$refs.audioDom.paused}),this.loopGapMillisecond+20)},timeupdateHandler:function(){var e=this;this.maxSecond=this.$refs.audioDom.duration,this.currentSecond=this.$refs.audioDom.currentTime,this.currentSecond<this.startSecond?this.allowSetCurrentTime&&(this.$refs.audioDom.currentTime=this.startSecond,this.allowSetCurrentTime=!1,setTimeout((function(){e.allowSetCurrentTime=!0}),1e3)):((0!==this.endSecond&&this.currentSecond>=this.endSecond||0!==this.maxSecond&&this.currentSecond>=this.maxSecond)&&this.loopPlayOrEndPause(),this.setIsPlaying())},endedHandler:function(){this.loopPlayOrEndPause()},pauseHandler:function(){this.setIsPlaying()}}};var n=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("span",[n("audio",{ref:"audioDom",attrs:{src:e.audioSrc,controls:e.controls,preload:e.preload},on:{timeupdate:e.timeupdateHandler,ended:e.endedHandler,pause:e.pauseHandler}}),e._v(" "),e._t("default",[n("br"),e._v("\n 正在播放:"+e._s(e.isPlaying)+"\n "),n("br"),e._v("\n 当前时间:"+e._s(e.currentSecond)+"\n "),n("br"),e._v("\n 最大时间:"+e._s(e.maxSecond)+"\n "),n("br")],{isPlaying:e.isPlaying,currentSecond:e.currentSecond,maxSecond:e.maxSecond})],2)};n._withStripped=!0;const o=e({render:n,staticRenderFns:[]},void 0,t,void 0,!1,void 0,!1,void 0,void 0,void 0);o.install=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.component(t.component||"vue-player-audio",o)};export default o; | ||
function e(e,t,o,n,i,s,r,a,d,u){"boolean"!=typeof r&&(d=a,a=r,r=!1);const c="function"==typeof o?o.options:o;let l;if(e&&e.render&&(c.render=e.render,c.staticRenderFns=e.staticRenderFns,c._compiled=!0,i&&(c.functional=!0)),n&&(c._scopeId=n),s?(l=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),t&&t.call(this,d(e)),e&&e._registeredComponents&&e._registeredComponents.add(s)},c._ssrRegister=l):t&&(l=r?function(e){t.call(this,u(e,this.$root.$options.shadowRoot))}:function(e){t.call(this,a(e))}),l)if(c.functional){const e=c.render;c.render=function(t,o){return l.call(o),e(t,o)}}else{const e=c.beforeCreate;c.beforeCreate=e?[].concat(e,l):[l]}return o}const t={props:{audioSrc:{type:String,required:!0},startSecond:{type:Number,default:0},endSecond:{type:Number,default:0},autoplay:{type:Boolean,default:!1},loop:{type:Boolean,default:!1},loopGapMillisecond:{type:Number,default:50},controls:{type:Boolean,default:!1},preload:{type:String,default:"metadata"}},data:function(){return{isPlaying:!1,currentSecond:this.startSecond,maxSecond:0,allowSetCurrentTime:!0,setTimeoutId1:0,setTimeoutId2:0,setTimeoutId3:0}},watch:{audioSrc:function(){this.beginPlay()},startSecond:function(){this.beginPlay()}},mounted:function(){this.beginPlay()},beforeDestroy:function(){clearTimeout(this.setTimeoutId1),clearTimeout(this.setTimeoutId2),clearTimeout(this.setTimeoutId3)},methods:{beginPlay:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.audioSrc;e&&(this.$refs.audioDom.currentTime=Math.max(this.startSecond,1e-6),this.autoplay&&this.$refs.audioDom.play())},loopPlayOrEndPause:function(){var e=this;this.loop?(this.$refs.audioDom.currentTime=this.startSecond,this.setTimeoutId2=setTimeout((function(){try{e.$refs.audioDom.play()}catch(e){}}),this.loopGapMillisecond)):(this.$refs.audioDom.pause(),this.$refs.audioDom.currentTime=this.startSecond)},setIsPlaying:function(){var e=this;clearTimeout(this.setTimeoutId1),this.setTimeoutId1=setTimeout((function(){try{e.isPlaying=!e.$refs.audioDom.paused}catch(e){}}),this.loopGapMillisecond+20)},timeupdateHandler:function(){var e=this;try{this.maxSecond=this.$refs.audioDom.duration,this.currentSecond=this.$refs.audioDom.currentTime,this.currentSecond<this.startSecond?this.allowSetCurrentTime&&(this.$refs.audioDom.currentTime=this.startSecond,this.allowSetCurrentTime=!1,this.setTimeoutId3=setTimeout((function(){e.allowSetCurrentTime=!0}),1e3)):((0!==this.endSecond&&this.currentSecond>=this.endSecond||0!==this.maxSecond&&this.currentSecond>=this.maxSecond)&&this.loopPlayOrEndPause(),this.setIsPlaying())}catch(e){}},endedHandler:function(){try{this.loopPlayOrEndPause()}catch(e){}},pauseHandler:function(){this.setIsPlaying()}}};var o=function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("span",[o("audio",{ref:"audioDom",attrs:{src:e.audioSrc,controls:e.controls,preload:e.preload},on:{timeupdate:e.timeupdateHandler,ended:e.endedHandler,pause:e.pauseHandler}}),e._v(" "),e._t("default",[o("br"),e._v("\n 正在播放:"+e._s(e.isPlaying)+"\n "),o("br"),e._v("\n 当前时间:"+e._s(e.currentSecond)+"\n "),o("br"),e._v("\n 最大时间:"+e._s(e.maxSecond)+"\n "),o("br")],{isPlaying:e.isPlaying,currentSecond:e.currentSecond,maxSecond:e.maxSecond})],2)};o._withStripped=!0;const n=e({render:o,staticRenderFns:[]},void 0,t,void 0,!1,void 0,!1,void 0,void 0,void 0);n.install=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.component(t.component||"vue-player-audio",n)};export default n; |
@@ -1,1 +0,1 @@ | ||
var vuePlayerAudio=function(){"use strict";var e=function(e,t,n,o,i,r,s,a,d,u){"boolean"!=typeof s&&(d=a,a=s,s=!1);var c,l="function"==typeof n?n.options:n;if(e&&e.render&&(l.render=e.render,l.staticRenderFns=e.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),o&&(l._scopeId=o),r?(c=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),t&&t.call(this,d(e)),e&&e._registeredComponents&&e._registeredComponents.add(r)},l._ssrRegister=c):t&&(c=s?function(){t.call(this,u(this.$root.$options.shadowRoot))}:function(e){t.call(this,a(e))}),c)if(l.functional){var h=l.render;l.render=function(e,t){return c.call(t),h(e,t)}}else{var f=l.beforeCreate;l.beforeCreate=f?[].concat(f,c):[c]}return n};const t={props:{audioSrc:{type:String,required:!0},startSecond:{type:Number,default:0},endSecond:{type:Number,default:0},autoplay:{type:Boolean,default:!1},loop:{type:Boolean,default:!1},loopGapMillisecond:{type:Number,default:50},controls:{type:Boolean,default:!1},preload:{type:String,default:"metadata"}},data:function(){return{isPlaying:!1,currentSecond:this.startSecond,maxSecond:0,setTimeoutId:0,allowSetCurrentTime:!0}},watch:{audioSrc:function(){this.beginPlay()},startSecond:function(){this.beginPlay()}},mounted:function(){this.beginPlay()},beforeDestroy:function(){clearTimeout(this.setTimeoutId)},methods:{beginPlay:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.audioSrc;e&&(this.$refs.audioDom.currentTime=Math.max(this.startSecond,1e-6),this.autoplay&&this.$refs.audioDom.play())},loopPlayOrEndPause:function(){var e=this;this.loop?(this.$refs.audioDom.currentTime=this.startSecond,setTimeout((function(){e.$refs.audioDom.play()}),this.loopGapMillisecond)):(this.$refs.audioDom.pause(),this.$refs.audioDom.currentTime=this.startSecond)},setIsPlaying:function(){var e=this;clearTimeout(this.setTimeoutId),this.setTimeoutId=setTimeout((function(){e.isPlaying=!e.$refs.audioDom.paused}),this.loopGapMillisecond+20)},timeupdateHandler:function(){var e=this;this.maxSecond=this.$refs.audioDom.duration,this.currentSecond=this.$refs.audioDom.currentTime,this.currentSecond<this.startSecond?this.allowSetCurrentTime&&(this.$refs.audioDom.currentTime=this.startSecond,this.allowSetCurrentTime=!1,setTimeout((function(){e.allowSetCurrentTime=!0}),1e3)):((0!==this.endSecond&&this.currentSecond>=this.endSecond||0!==this.maxSecond&&this.currentSecond>=this.maxSecond)&&this.loopPlayOrEndPause(),this.setIsPlaying())},endedHandler:function(){this.loopPlayOrEndPause()},pauseHandler:function(){this.setIsPlaying()}}};var n=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("span",[n("audio",{ref:"audioDom",attrs:{src:e.audioSrc,controls:e.controls,preload:e.preload},on:{timeupdate:e.timeupdateHandler,ended:e.endedHandler,pause:e.pauseHandler}}),e._v(" "),e._t("default",[n("br"),e._v("\n 正在播放:"+e._s(e.isPlaying)+"\n "),n("br"),e._v("\n 当前时间:"+e._s(e.currentSecond)+"\n "),n("br"),e._v("\n 最大时间:"+e._s(e.maxSecond)+"\n "),n("br")],{isPlaying:e.isPlaying,currentSecond:e.currentSecond,maxSecond:e.maxSecond})],2)};n._withStripped=!0;const o=e({render:n,staticRenderFns:[]},void 0,t,void 0,!1,void 0,!1,void 0,void 0,void 0);return o.install=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.component(t.component||"vue-player-audio",o)},o}(); | ||
var vuePlayerAudio=function(){"use strict";function e(e,t,n,o,i,s,r,a,d,u){"boolean"!=typeof r&&(d=a,a=r,r=!1);const c="function"==typeof n?n.options:n;let l;if(e&&e.render&&(c.render=e.render,c.staticRenderFns=e.staticRenderFns,c._compiled=!0,i&&(c.functional=!0)),o&&(c._scopeId=o),s?(l=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),t&&t.call(this,d(e)),e&&e._registeredComponents&&e._registeredComponents.add(s)},c._ssrRegister=l):t&&(l=r?function(e){t.call(this,u(e,this.$root.$options.shadowRoot))}:function(e){t.call(this,a(e))}),l)if(c.functional){const e=c.render;c.render=function(t,n){return l.call(n),e(t,n)}}else{const e=c.beforeCreate;c.beforeCreate=e?[].concat(e,l):[l]}return n}const t={props:{audioSrc:{type:String,required:!0},startSecond:{type:Number,default:0},endSecond:{type:Number,default:0},autoplay:{type:Boolean,default:!1},loop:{type:Boolean,default:!1},loopGapMillisecond:{type:Number,default:50},controls:{type:Boolean,default:!1},preload:{type:String,default:"metadata"}},data:function(){return{isPlaying:!1,currentSecond:this.startSecond,maxSecond:0,allowSetCurrentTime:!0,setTimeoutId1:0,setTimeoutId2:0,setTimeoutId3:0}},watch:{audioSrc:function(){this.beginPlay()},startSecond:function(){this.beginPlay()}},mounted:function(){this.beginPlay()},beforeDestroy:function(){clearTimeout(this.setTimeoutId1),clearTimeout(this.setTimeoutId2),clearTimeout(this.setTimeoutId3)},methods:{beginPlay:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.audioSrc;e&&(this.$refs.audioDom.currentTime=Math.max(this.startSecond,1e-6),this.autoplay&&this.$refs.audioDom.play())},loopPlayOrEndPause:function(){var e=this;this.loop?(this.$refs.audioDom.currentTime=this.startSecond,this.setTimeoutId2=setTimeout((function(){try{e.$refs.audioDom.play()}catch(e){}}),this.loopGapMillisecond)):(this.$refs.audioDom.pause(),this.$refs.audioDom.currentTime=this.startSecond)},setIsPlaying:function(){var e=this;clearTimeout(this.setTimeoutId1),this.setTimeoutId1=setTimeout((function(){try{e.isPlaying=!e.$refs.audioDom.paused}catch(e){}}),this.loopGapMillisecond+20)},timeupdateHandler:function(){var e=this;try{this.maxSecond=this.$refs.audioDom.duration,this.currentSecond=this.$refs.audioDom.currentTime,this.currentSecond<this.startSecond?this.allowSetCurrentTime&&(this.$refs.audioDom.currentTime=this.startSecond,this.allowSetCurrentTime=!1,this.setTimeoutId3=setTimeout((function(){e.allowSetCurrentTime=!0}),1e3)):((0!==this.endSecond&&this.currentSecond>=this.endSecond||0!==this.maxSecond&&this.currentSecond>=this.maxSecond)&&this.loopPlayOrEndPause(),this.setIsPlaying())}catch(e){}},endedHandler:function(){try{this.loopPlayOrEndPause()}catch(e){}},pauseHandler:function(){this.setIsPlaying()}}};var n=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("span",[n("audio",{ref:"audioDom",attrs:{src:e.audioSrc,controls:e.controls,preload:e.preload},on:{timeupdate:e.timeupdateHandler,ended:e.endedHandler,pause:e.pauseHandler}}),e._v(" "),e._t("default",[n("br"),e._v("\n 正在播放:"+e._s(e.isPlaying)+"\n "),n("br"),e._v("\n 当前时间:"+e._s(e.currentSecond)+"\n "),n("br"),e._v("\n 最大时间:"+e._s(e.maxSecond)+"\n "),n("br")],{isPlaying:e.isPlaying,currentSecond:e.currentSecond,maxSecond:e.maxSecond})],2)};n._withStripped=!0;const o=e({render:n,staticRenderFns:[]},void 0,t,void 0,!1,void 0,!1,void 0,void 0,void 0);return o.install=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.component(t.component||"vue-player-audio",o)},o}(); |
@@ -27,13 +27,13 @@ { | ||
"devDependencies": { | ||
"@babel/core": "^7.7.5", | ||
"@babel/preset-env": "^7.7.6", | ||
"@babel/core": "^7.10.2", | ||
"@babel/preset-env": "^7.10.2", | ||
"babelrc-rollup": "^3.0.0", | ||
"rollup": "^1.27.9", | ||
"rollup-plugin-babel": "^4.3.3", | ||
"rollup": "^2.16.1", | ||
"rollup-plugin-babel": "^4.4.0", | ||
"rollup-plugin-commonjs": "^10.1.0", | ||
"rollup-plugin-terser": "^5.1.2", | ||
"rollup-plugin-vue": "5.0.1", | ||
"vue-template-compiler": "^2.6.10" | ||
"rollup-plugin-terser": "^6.1.0", | ||
"rollup-plugin-vue": "^5.1.9", | ||
"vue-template-compiler": "^2.6.11" | ||
}, | ||
"version": "1.0.0" | ||
"version": "1.0.1" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
95
42268