capacitor-youtube-player
Advanced tools
Comparing version
@@ -1,2 +0,2 @@ | ||
import type { IPlayerState, IPlayerOptions } from './web/models/models'; | ||
import type { IPlayerState, IPlayerOptions, IPlaylistOptions } from './web/models/models'; | ||
export interface YoutubePlayerPlugin { | ||
@@ -76,2 +76,17 @@ initialize(options: IPlayerOptions): Promise<{ | ||
/***********/ | ||
cuePlaylist(playerId: string, playlistOptions: IPlaylistOptions): Promise<{ | ||
result: { | ||
method: string; | ||
value: boolean; | ||
}; | ||
}>; | ||
loadPlaylist(playerId: string, playlistOptions: IPlaylistOptions): Promise<{ | ||
result: { | ||
method: string; | ||
value: boolean; | ||
}; | ||
}>; | ||
/***********/ | ||
/***********/ | ||
/***********/ | ||
mute(playerId: string): Promise<{ | ||
@@ -78,0 +93,0 @@ result: { |
import { WebPlugin } from '@capacitor/core'; | ||
import type { YoutubePlayerPlugin } from './definitions'; | ||
import type { IPlayerSize, IPlayerState, IPlayerOptions, RequiredKeys } from './web/models/models'; | ||
import type { IPlayerSize, IPlayerState, IPlayerOptions, RequiredKeys, IPlaylistOptions } from './web/models/models'; | ||
export declare function YT(): any; | ||
@@ -94,2 +94,16 @@ export declare function Player(): any; | ||
/*********/ | ||
cuePlaylist(playerId: string, playlistOptions: IPlaylistOptions): Promise<{ | ||
result: { | ||
method: string; | ||
value: boolean; | ||
}; | ||
}>; | ||
loadPlaylist(playerId: string, playlistOptions: IPlaylistOptions): Promise<{ | ||
result: { | ||
method: string; | ||
value: boolean; | ||
}; | ||
}>; | ||
/*********/ | ||
/*********/ | ||
mute(playerId: string): Promise<{ | ||
@@ -96,0 +110,0 @@ result: { |
@@ -180,2 +180,15 @@ import { WebPlugin } from '@capacitor/core'; | ||
/*********/ | ||
// Methods for playing playlist. | ||
/*********/ | ||
async cuePlaylist(playerId, playlistOptions) { | ||
this.playerLogger.log(`player "${playerId}" -> cuePlaylist with options ${JSON.stringify(playlistOptions)}`); | ||
this.players[playerId].cuePlaylist(playlistOptions); | ||
return Promise.resolve({ result: { method: 'cuePlaylist', value: true } }); | ||
} | ||
async loadPlaylist(playerId, playlistOptions) { | ||
this.playerLogger.log(`player "${playerId}" -> loadPlaylist with options ${playlistOptions}`); | ||
this.players[playerId].loadPlaylist(playlistOptions); | ||
return Promise.resolve({ result: { method: 'loadPlaylist', value: true } }); | ||
} | ||
/*********/ | ||
// Methods changing the player volume. | ||
@@ -182,0 +195,0 @@ /*********/ |
@@ -46,2 +46,9 @@ export declare type RequiredKeys<T, K extends keyof T> = Exclude<T, K> & { | ||
} | ||
export interface IPlaylistOptions { | ||
listType: 'playlist' | 'search' | 'user_uploads'; | ||
list: string; | ||
index?: number; | ||
startSeconds?: number; | ||
suggestedQuality?: string; | ||
} | ||
export interface IPlayerLog { | ||
@@ -48,0 +55,0 @@ log(primaryMessage: string, ...supportingData: any[]): void; |
@@ -216,2 +216,15 @@ 'use strict'; | ||
/*********/ | ||
// Methods for playing playlist. | ||
/*********/ | ||
async cuePlaylist(playerId, playlistOptions) { | ||
this.playerLogger.log(`player "${playerId}" -> cuePlaylist with options ${JSON.stringify(playlistOptions)}`); | ||
this.players[playerId].cuePlaylist(playlistOptions); | ||
return Promise.resolve({ result: { method: 'cuePlaylist', value: true } }); | ||
} | ||
async loadPlaylist(playerId, playlistOptions) { | ||
this.playerLogger.log(`player "${playerId}" -> loadPlaylist with options ${playlistOptions}`); | ||
this.players[playerId].loadPlaylist(playlistOptions); | ||
return Promise.resolve({ result: { method: 'loadPlaylist', value: true } }); | ||
} | ||
/*********/ | ||
// Methods changing the player volume. | ||
@@ -218,0 +231,0 @@ /*********/ |
@@ -213,2 +213,15 @@ var capacitorPlugin = (function (exports, core) { | ||
/*********/ | ||
// Methods for playing playlist. | ||
/*********/ | ||
async cuePlaylist(playerId, playlistOptions) { | ||
this.playerLogger.log(`player "${playerId}" -> cuePlaylist with options ${JSON.stringify(playlistOptions)}`); | ||
this.players[playerId].cuePlaylist(playlistOptions); | ||
return Promise.resolve({ result: { method: 'cuePlaylist', value: true } }); | ||
} | ||
async loadPlaylist(playerId, playlistOptions) { | ||
this.playerLogger.log(`player "${playerId}" -> loadPlaylist with options ${playlistOptions}`); | ||
this.players[playerId].loadPlaylist(playlistOptions); | ||
return Promise.resolve({ result: { method: 'loadPlaylist', value: true } }); | ||
} | ||
/*********/ | ||
// Methods changing the player volume. | ||
@@ -215,0 +228,0 @@ /*********/ |
{ | ||
"name": "capacitor-youtube-player", | ||
"version": "1.0.8", | ||
"version": "1.0.9", | ||
"description": "Capacitor Youtube Player", | ||
@@ -29,6 +29,6 @@ "main": "dist/plugin.cjs.js", | ||
"devDependencies": { | ||
"@capacitor/android": "^3.3.1", | ||
"@capacitor/core": "^3.3.1", | ||
"@capacitor/android": "^3.3.2", | ||
"@capacitor/core": "^3.3.2", | ||
"@capacitor/docgen": "0.0.18", | ||
"@capacitor/ios": "^3.3.1", | ||
"@capacitor/ios": "^3.3.2", | ||
"@ionic/eslint-config": "^0.3.0", | ||
@@ -38,11 +38,11 @@ "@ionic/prettier-config": "^2.0.0", | ||
"eslint": "^7.32.0", | ||
"prettier": "^2.4.1", | ||
"prettier": "^2.5.0", | ||
"prettier-plugin-java": "^1.6.0", | ||
"rimraf": "^3.0.2", | ||
"rollup": "^2.60.0", | ||
"rollup": "^2.60.2", | ||
"swiftlint": "^1.0.1", | ||
"typescript": "^4.3.5" | ||
"typescript": "^4.5.2" | ||
}, | ||
"peerDependencies": { | ||
"@capacitor/core": "^3.0.0" | ||
"@capacitor/core": "^3.3.2" | ||
}, | ||
@@ -49,0 +49,0 @@ "prettier": "@ionic/prettier-config", |
@@ -27,2 +27,4 @@  | ||
 | ||
 | ||
@@ -29,0 +31,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
289925
2.37%1565
5.03%300
0.67%