vue-youtube
Advanced tools
Comparing version 1.3.2 to 1.3.3
/*! | ||
* vue-youtube v1.3.1 | ||
* vue-youtube v1.3.3 | ||
* (c) 2018 Antério Vieira | ||
@@ -105,3 +105,3 @@ * Released under the MIT License. | ||
type: Boolean, | ||
default: true | ||
default: false | ||
} | ||
@@ -231,3 +231,3 @@ }, | ||
var version = '1.3.1'; | ||
var version = '1.3.3'; | ||
@@ -234,0 +234,0 @@ exports['default'] = plugin; |
/*! | ||
* vue-youtube v1.3.1 | ||
* vue-youtube v1.3.3 | ||
* (c) 2018 Antério Vieira | ||
@@ -101,3 +101,3 @@ * Released under the MIT License. | ||
type: Boolean, | ||
default: true | ||
default: false | ||
} | ||
@@ -227,4 +227,4 @@ }, | ||
var version = '1.3.1'; | ||
var version = '1.3.3'; | ||
export { Youtube, version };export default plugin; |
/*! | ||
* vue-youtube v1.3.1 | ||
* vue-youtube v1.3.3 | ||
* (c) 2018 Antério Vieira | ||
@@ -107,3 +107,3 @@ * Released under the MIT License. | ||
type: Boolean, | ||
default: true | ||
default: false | ||
} | ||
@@ -233,3 +233,3 @@ }, | ||
var version = '1.3.1'; | ||
var version = '1.3.3'; | ||
@@ -236,0 +236,0 @@ exports['default'] = plugin; |
/*! | ||
* vue-youtube v1.3.1 | ||
* vue-youtube v1.3.3 | ||
* (c) 2018 Antério Vieira | ||
@@ -7,2 +7,2 @@ * Released under the MIT License. | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.VueYoutube=e.VueYoutube||{})}(this,function(e){"use strict";function t(e){e.prototype.$youtube={getIdFromUrl:i},e.component("youtube",o)}"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var i=function(e,t){return t={exports:{}},e(t,t.exports),t.exports}(function(e,t){!function(t,i){e.exports=i()}(0,function(e){return function(e,t){if(void 0==t&&(t={fuzzy:!0}),/youtu\.?be/.test(e)){var i,r=[/youtu\.be\/([^#\&\?]{11})/,/\?v=([^#\&\?]{11})/,/\&v=([^#\&\?]{11})/,/embed\/([^#\&\?]{11})/,/\/v\/([^#\&\?]{11})/];for(i=0;i<r.length;++i)if(r[i].test(e))return r[i].exec(e)[1];if(t.fuzzy){var o=e.split(/[\/\&\?=#\.\s]/g);for(i=0;i<o.length;++i)if(/^[^#\&\?]{11}$/.test(o[i]))return o[i]}}return null}})}),r=require("youtube-player"),o={name:"Youtube",props:{videoId:String,playerVars:{type:Object,default:function(){return{}}},height:{type:[Number,String],default:360},width:{type:[Number,String],default:640},resize:{type:Boolean,default:!1},resizeDelay:{type:Number,default:100},fitParent:{type:Boolean,default:!0}},data:function(){return{player:{},events:(e={},e[-1]="unstarted",e[1]="playing",e[2]="paused",e[0]="ended",e[3]="buffering",e[5]="cued",e),resizeTimeout:null};var e},computed:{aspectRatio:function(){return this.width/this.height}},methods:{playerReady:function(e){this.$emit("ready",e.target)},playerStateChange:function(e){null!==e.data&&-1!==e.data&&this.$emit(this.events[e.data],e.target)},playerError:function(e){this.$emit("error",e.target)},updatePlayer:function(e){e?1!==this.playerVars.autoplay?this.player.cueVideoById({videoId:e}):this.player.loadVideoById({videoId:e}):this.player.stopVideo()},resizeProportionally:function(){var e=this;this.player.getIframe().then(function(t){var i=e.fitParent?t.parentElement.offsetWidth:t.offsetWidth,r=i/e.aspectRatio;e.player.setSize(i,r)})},onResize:function(){clearTimeout(this.resizeTimeout),this.resizeTimeout=setTimeout(this.resizeProportionally,this.resizeDelay)}},watch:{videoId:"updatePlayer",resize:function(e){e?(window.addEventListener("resize",this.onResize),this.resizeProportionally()):(window.removeEventListener("resize",this.onResize),this.player.setSize(this.width,this.height))},width:function(e){this.player.setSize(e,this.height)},height:function(e){this.player.setSize(this.width,e)}},beforeDestroy:function(){null!==this.player&&this.player.destroy&&(this.player.destroy(),delete this.player)},mounted:function(){window.YTConfig={host:"https://www.youtube.com"},this.player=r(this.$el,{width:this.width,height:this.height,videoId:this.videoId,playerVars:this.playerVars}),this.player.on("ready",this.playerReady),this.player.on("stateChange",this.playerStateChange),this.player.on("error",this.playerError),this.resize&&window.addEventListener("resize",this.onResize),this.fitParent&&this.resizeProportionally()},render:function(e){return e("div")}};"undefined"!=typeof window&&window.Vue&&window.Vue.use(t);e.default=t,e.Youtube=o,e.version="1.3.1",Object.defineProperty(e,"__esModule",{value:!0})}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.VueYoutube=e.VueYoutube||{})}(this,function(e){"use strict";function t(e){e.prototype.$youtube={getIdFromUrl:i},e.component("youtube",o)}"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var i=function(e,t){return t={exports:{}},e(t,t.exports),t.exports}(function(e,t){!function(t,i){e.exports=i()}(0,function(e){return function(e,t){if(void 0==t&&(t={fuzzy:!0}),/youtu\.?be/.test(e)){var i,r=[/youtu\.be\/([^#\&\?]{11})/,/\?v=([^#\&\?]{11})/,/\&v=([^#\&\?]{11})/,/embed\/([^#\&\?]{11})/,/\/v\/([^#\&\?]{11})/];for(i=0;i<r.length;++i)if(r[i].test(e))return r[i].exec(e)[1];if(t.fuzzy){var o=e.split(/[\/\&\?=#\.\s]/g);for(i=0;i<o.length;++i)if(/^[^#\&\?]{11}$/.test(o[i]))return o[i]}}return null}})}),r=require("youtube-player"),o={name:"Youtube",props:{videoId:String,playerVars:{type:Object,default:function(){return{}}},height:{type:[Number,String],default:360},width:{type:[Number,String],default:640},resize:{type:Boolean,default:!1},resizeDelay:{type:Number,default:100},fitParent:{type:Boolean,default:!1}},data:function(){return{player:{},events:(e={},e[-1]="unstarted",e[1]="playing",e[2]="paused",e[0]="ended",e[3]="buffering",e[5]="cued",e),resizeTimeout:null};var e},computed:{aspectRatio:function(){return this.width/this.height}},methods:{playerReady:function(e){this.$emit("ready",e.target)},playerStateChange:function(e){null!==e.data&&-1!==e.data&&this.$emit(this.events[e.data],e.target)},playerError:function(e){this.$emit("error",e.target)},updatePlayer:function(e){e?1!==this.playerVars.autoplay?this.player.cueVideoById({videoId:e}):this.player.loadVideoById({videoId:e}):this.player.stopVideo()},resizeProportionally:function(){var e=this;this.player.getIframe().then(function(t){var i=e.fitParent?t.parentElement.offsetWidth:t.offsetWidth,r=i/e.aspectRatio;e.player.setSize(i,r)})},onResize:function(){clearTimeout(this.resizeTimeout),this.resizeTimeout=setTimeout(this.resizeProportionally,this.resizeDelay)}},watch:{videoId:"updatePlayer",resize:function(e){e?(window.addEventListener("resize",this.onResize),this.resizeProportionally()):(window.removeEventListener("resize",this.onResize),this.player.setSize(this.width,this.height))},width:function(e){this.player.setSize(e,this.height)},height:function(e){this.player.setSize(this.width,e)}},beforeDestroy:function(){null!==this.player&&this.player.destroy&&(this.player.destroy(),delete this.player)},mounted:function(){window.YTConfig={host:"https://www.youtube.com"},this.player=r(this.$el,{width:this.width,height:this.height,videoId:this.videoId,playerVars:this.playerVars}),this.player.on("ready",this.playerReady),this.player.on("stateChange",this.playerStateChange),this.player.on("error",this.playerError),this.resize&&window.addEventListener("resize",this.onResize),this.fitParent&&this.resizeProportionally()},render:function(e){return e("div")}};"undefined"!=typeof window&&window.Vue&&window.Vue.use(t);e.default=t,e.Youtube=o,e.version="1.3.3",Object.defineProperty(e,"__esModule",{value:!0})}); |
{ | ||
"name": "vue-youtube", | ||
"version": "1.3.2", | ||
"version": "1.3.3", | ||
"description": "YouTube IFrame Player API wrapper", | ||
@@ -5,0 +5,0 @@ "author": "Antério Vieira", |
@@ -163,3 +163,3 @@ <p align="center"> | ||
| resizeDelay | Number | 200 | Delay in milliseconds before running resize callback | | ||
| fitParent | Number | true | `iframe` will use its parent's width | | ||
| fitParent | Number | false | `iframe` will use its parent's width | | ||
@@ -166,0 +166,0 @@ #### Tips for Resizing |
@@ -36,3 +36,3 @@ const player = require('youtube-player') | ||
type: Boolean, | ||
default: true | ||
default: false | ||
} | ||
@@ -39,0 +39,0 @@ }, |
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
34994