capacitor-youtube-player
Advanced tools
Comparing version
@@ -65,6 +65,11 @@ import { WebPlugin } from '@capacitor/core'; | ||
// The API will call this function when the video player is ready. | ||
'onReady': () => { | ||
'onReady': (event) => { | ||
var _a; | ||
this.playerLogger.log(`player "${options.playerId}" -> onPlayerReady`); | ||
const state = { events: { onReady: { text: 'onReady', value: true } } }; | ||
this.playersEventsState.set(options.playerId, state); | ||
if (((_a = options === null || options === void 0 ? void 0 : options.playerVars) === null || _a === void 0 ? void 0 : _a.autoplay) === 1) { | ||
event.target.mute(); | ||
event.target.playVideo(); | ||
} | ||
return resolve({ playerReady: true, player: this.players[options.playerId] }); | ||
@@ -71,0 +76,0 @@ }, |
@@ -101,6 +101,11 @@ 'use strict'; | ||
// The API will call this function when the video player is ready. | ||
'onReady': () => { | ||
'onReady': (event) => { | ||
var _a; | ||
this.playerLogger.log(`player "${options.playerId}" -> onPlayerReady`); | ||
const state = { events: { onReady: { text: 'onReady', value: true } } }; | ||
this.playersEventsState.set(options.playerId, state); | ||
if (((_a = options === null || options === void 0 ? void 0 : options.playerVars) === null || _a === void 0 ? void 0 : _a.autoplay) === 1) { | ||
event.target.mute(); | ||
event.target.playVideo(); | ||
} | ||
return resolve({ playerReady: true, player: this.players[options.playerId] }); | ||
@@ -107,0 +112,0 @@ }, |
@@ -98,6 +98,11 @@ var capacitorPlugin = (function (exports, core) { | ||
// The API will call this function when the video player is ready. | ||
'onReady': () => { | ||
'onReady': (event) => { | ||
var _a; | ||
this.playerLogger.log(`player "${options.playerId}" -> onPlayerReady`); | ||
const state = { events: { onReady: { text: 'onReady', value: true } } }; | ||
this.playersEventsState.set(options.playerId, state); | ||
if (((_a = options === null || options === void 0 ? void 0 : options.playerVars) === null || _a === void 0 ? void 0 : _a.autoplay) === 1) { | ||
event.target.mute(); | ||
event.target.playVideo(); | ||
} | ||
return resolve({ playerReady: true, player: this.players[options.playerId] }); | ||
@@ -104,0 +109,0 @@ }, |
{ | ||
"name": "capacitor-youtube-player", | ||
"version": "1.0.7", | ||
"version": "1.0.8", | ||
"description": "Capacitor Youtube Player", | ||
@@ -5,0 +5,0 @@ "main": "dist/plugin.cjs.js", |
@@ -44,2 +44,42 @@  | ||
**IMPORTANT NOTE** | ||
----- | ||
### Autoplay | ||
Currently most browsers **do not support autoplay unless the video is loaded without sound.** | ||
This is the behaviour of the web plugin if you pass a value of 1 in the autoplay parameter of playerVars. | ||
The video will start playing but without sound. | ||
``` bash | ||
... | ||
playerVars: { | ||
autoplay: 1, | ||
rel: 0, | ||
color: 'white', | ||
showinfo: 1, | ||
}, | ||
... | ||
``` | ||
You can read more about the autoplay policy in different browsers by clicking on the following links: | ||
[Google Chrome](https://developer.chrome.com/blog/autoplay/) | ||
[Firefox](https://blog.mozilla.org/en/products/firefox/block-autoplay/) | ||
### Fullscreen | ||
To display a video in full screen, **user interaction is required**... either by clicking on the play button, another button,... | ||
You can read more about the fullscreen policy in different browsers by clicking on the following links: | ||
[Google Chrome](https://developers.google.com/web/fundamentals/native-hardware/fullscreen) | ||
----- | ||
Functionality | Methods | Description | Expects | Returns | ||
@@ -46,0 +86,0 @@ ----------------|----------------|-------------|--------|-------- |
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
283200
1.27%1490
1.02%298
15.5%