Skip to content

Commit 9c73ab7

Browse files
committed
player.ts: Fixed playerVars passing to player
player.ts didn't pass the playerVars / playerParameters correctly which caused the player to ignore these parameters.
1 parent 399aef9 commit 9c73ab7

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This plugin makes it easy to integrate the YouTube Iframe API into your Vue app.
44

55
## Notice
66

7-
⚠️ The new version `1.0.5` (rewritten in Typescript) introduces the following breaking change:
7+
⚠️ The new version `1.0.6` (rewritten in Typescript) introduces the following breaking change:
88

99
The events `@ended`, `@playing`, `@paused`, `@buffering` and `@cued` will no longer be emitted. Instead you should now
1010
use `@state-change` to catch the events when the player state changes. This better represents the behaviour of the

rollup.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const now = new Date();
66
const banner = `// Copyright (c) 2020-present Techassi
77
// Use of this source code is governed by a MIT-style
88
// license that can be found in the LICENSE file.
9-
// vue-youtube-iframe ${version} build ${now.getUTCDate()}/${now.getUTCMonth()}/${now.getUTCFullYear()}`;
9+
// vue-youtube-iframe ${version} build ${now.getUTCDate()}/${now.getUTCMonth() + 1}/${now.getUTCFullYear()}`;
1010

1111
export default {
1212
input: './src/index.ts',

src/player.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,22 +44,22 @@ const player = defineComponent({
4444
return h('div', { class: ['vue-youtube-iframe'] }, [h('div', { id: this.elementId })]);
4545
},
4646
mounted() {
47-
const { playerHeight, playerWidth, playerParameters, videoId } = this;
48-
4947
manager.register((factory, uid) => {
5048
const host = this.noCookie ? HOST_NO_COOKIE : HOST_COOKIE;
5149
this.elementId = uid;
5250

5351
nextTick().then(() => {
5452
this.playerInstance = createPlayer(factory, this.elementId, {
55-
width: playerWidth,
56-
height: playerHeight,
57-
...playerParameters,
58-
videoId,
53+
width: this.playerWidth,
54+
height: this.playerHeight,
55+
playerVars: {
56+
...this.playerParameters,
57+
},
58+
videoId: this.videoId,
5959
host,
6060
events: {
6161
onReady: (event: YT.PlayerEvent) => {
62-
seekIfAutoplay(event.target, playerParameters);
62+
seekIfAutoplay(event.target, this.playerParameters);
6363
this.$emit('ready', event);
6464
},
6565
onStateChange: (event: YT.OnStateChangeEvent) => {

0 commit comments

Comments
 (0)