@vue-youtube/shared
Advanced tools
Comparing version 0.0.5 to 0.0.6
@@ -1,7 +0,492 @@ | ||
export * from './constants'; | ||
export * from './types/options'; | ||
export * from './types/quality'; | ||
export * from './types/events'; | ||
export * from './types/player'; | ||
export * from './types/enums'; | ||
export * from './refs'; | ||
import type { ComponentPublicInstance } from 'vue-demi'; | ||
import type { Ref } from 'vue-demi'; | ||
export declare type AnyEvent = PlaybackQualityChangeEvent | PlaybackRateChangeEvent | PlayerStateChangeEvent | PlayerEvent | ErrorEvent_2; | ||
export declare type APIChangeCallback = PlayerEventCallback<PlayerEvent>; | ||
export declare type AutohideOption = 0 | 1 | 2; | ||
export declare type AutoplayOption = 0 | 1; | ||
export declare type CCLoadPolicyOption = 0 | 1; | ||
export declare type ControlsOption = 0 | 1 | 2; | ||
declare type ErrorCallback_2 = PlayerEventCallback<ErrorEvent_2>; | ||
export { ErrorCallback_2 as ErrorCallback } | ||
declare interface ErrorEvent_2 extends PlayerEvent { | ||
data: PlayerError; | ||
} | ||
export { ErrorEvent_2 as ErrorEvent } | ||
export declare interface Events { | ||
onPlaybackQualityChange?: PlaybackQualityChangeCallback | undefined; | ||
onPlaybackRateChange?: PlaybackRateChangeCallback | undefined; | ||
onStateChange?: PlayerStateChangeCallback | undefined; | ||
onApiChange?: APIChangeCallback | undefined; | ||
onReady?: ReadyCallback | undefined; | ||
onError?: ErrorCallback_2 | undefined; | ||
} | ||
export declare type FullscreenOption = 0 | 1; | ||
export declare const HOST_COOKIE = "https://www.youtube.com"; | ||
export declare const HOST_NO_COOKIE = "https://www.youtube-nocookie.com"; | ||
export declare type IVPolicyOption = 1 | 3; | ||
export declare type JSAPIOptions = 0 | 1; | ||
export declare type KeyboardOptions = 0 | 1; | ||
export declare type ListType = 'search' | 'user_uploads' | 'playlist'; | ||
export declare type LoopOption = 0 | 1; | ||
export declare type MaybeElementRef = MaybeRef<HTMLElement | ComponentPublicInstance | undefined | null>; | ||
export declare type MaybeRef<T> = T | Ref<T>; | ||
export declare type ModestBrandingOption = 0 | 1; | ||
export declare type MuteOption = 0 | 1; | ||
export declare type PlaybackQualityChangeCallback = PlayerEventCallback<PlaybackQualityChangeEvent>; | ||
export declare interface PlaybackQualityChangeEvent extends PlayerEvent { | ||
data: VideoQuality; | ||
} | ||
export declare type PlaybackRateChangeCallback = PlayerEventCallback<PlaybackRateChangeEvent>; | ||
export declare interface PlaybackRateChangeEvent extends PlayerEvent { | ||
data: number; | ||
} | ||
export declare interface Player { | ||
/** | ||
* cueVideoById queues a video by ID | ||
* | ||
* @param videoId YouTube video ID | ||
* @param startSeconds Time in seconds from which the video should start playing | ||
* @param suggestedQuality Suggested video player quality | ||
*/ | ||
cueVideoById(videoId: string, startSeconds?: number, suggestedQuality?: VideoQuality): void; | ||
/** | ||
* cueVideoById queues a video by ID | ||
* | ||
* @param settings Settings to queue the video | ||
*/ | ||
cueVideoById(settings: VideoByIdSettings): void; | ||
/** | ||
* loadVideoById loads a video by ID | ||
* | ||
* @param videoId YouTube video ID | ||
* @param startSeconds Time in seconds from which the video should start playing | ||
* @param suggestedQuality Suggested video player quality | ||
*/ | ||
loadVideoById(videoId: string, startSeconds?: number, suggestedQuality?: VideoQuality): void; | ||
/** | ||
* loadVideoById loads and plays a video by ID | ||
* | ||
* @param settings Settings to play the video | ||
*/ | ||
loadVideoById(settings: VideoByIdSettings): void; | ||
/** | ||
* cueVideoByUrl queues a video by URL | ||
* | ||
* @param mediaContentUrl Fully qualified player URL | ||
* @param startSeconds Time in seconds from which the video should start playing | ||
* @param suggestedQuality Suggested video player quality | ||
*/ | ||
cueVideoByUrl(mediaContentUrl: string, startSeconds?: number, suggestedQuality?: VideoQuality): void; | ||
/** | ||
* cueVideoByUrl queues a video by media content URL | ||
* | ||
* @param settings Settings to play the video. | ||
*/ | ||
cueVideoByUrl(settings: VideoByMediaContentUrlSettings): void; | ||
/** | ||
* loadVideoByUrl loads a video by URL | ||
* | ||
* @param mediaContentUrl Fully qualified player URL | ||
* @param startSeconds Time in seconds from which the video should start playing | ||
* @param suggestedQuality Suggested video player quality | ||
*/ | ||
loadVideoByUrl(mediaContentUrl: string, startSeconds?: number, suggestedQuality?: VideoQuality): void; | ||
/** | ||
* loadVideoByUrl loads a video by media content URL | ||
* | ||
* @param settings Settings to play the video | ||
*/ | ||
loadVideoByUrl(settings: { | ||
mediaContentUrl: string; | ||
startSeconds?: number | undefined; | ||
endSeconds?: number | undefined; | ||
suggestedQuality?: VideoQuality | undefined; | ||
}): void; | ||
/** | ||
* cuePlaylist queues one ore more videos by ID | ||
* | ||
* @param playlist Video ID(s) to play | ||
* @param index Start index of the playlist (default 0) | ||
* @param startSeconds Time in seconds from which the video should start playing | ||
* @param suggestedQuality Suggested video player quality | ||
*/ | ||
cuePlaylist(playlist: string | string[], index?: number, startSeconds?: number, suggestedQuality?: VideoQuality): void; | ||
/** | ||
* cuePlaylist queues a playlist of videos | ||
* | ||
* @param settings Settings to queue the playlist | ||
*/ | ||
cuePlaylist(settings: PlaylistSettings): void; | ||
/** | ||
* loadPlaylist loads a playlist of videos | ||
* | ||
* @param playlist Video ID(s) to play. | ||
* @param index Start index of the playlist, if not 0 | ||
* @param startSeconds Time from which the video should start playing | ||
* @param suggestedQuality Suggested video player quality | ||
*/ | ||
loadPlaylist(playlist: string | string[], index?: number, startSeconds?: number, suggestedQuality?: VideoQuality): void; | ||
/** | ||
* loadPlaylist loads a playlist of videos | ||
* | ||
* @param settings Settings to queue the playlist | ||
*/ | ||
loadPlaylist(settings: PlaylistSettings): void; | ||
/** | ||
* playVideo plays the currently cued/loaded video | ||
*/ | ||
playVideo(): void; | ||
/** | ||
* pauseVideo pauses the currently playing video | ||
*/ | ||
pauseVideo(): void; | ||
/** | ||
* stopVideo stops and cancels loading of the current video | ||
*/ | ||
stopVideo(): void; | ||
/** | ||
* seekTo seeks to a specified time in the video | ||
* | ||
* @param seconds Time, in seconds from the beginning of the video | ||
* @param allowSeekAhead Whether the player is allowed to make a new request for unbuffered data | ||
*/ | ||
seekTo(seconds: number, allowSeekAhead: boolean): void; | ||
/** | ||
* nextVideo loads and plays the next video in the playlist | ||
*/ | ||
nextVideo(): void; | ||
/** | ||
* previousVideo loads and plays the previous video in the playlist | ||
*/ | ||
previousVideo(): void; | ||
/** | ||
* playVideoAt loads and plays the specified video in the playlist | ||
* | ||
* @param index Index of the video to play | ||
*/ | ||
playVideoAt(index: number): void; | ||
/** | ||
* mute mutes the player | ||
*/ | ||
mute(): void; | ||
/** | ||
* unMute unmutes the player | ||
*/ | ||
unMute(): void; | ||
/** | ||
* @returns Whether the player is muted | ||
*/ | ||
isMuted(): boolean; | ||
/** | ||
* setVolume sets the player volume | ||
* | ||
* @param volume An integer between 0 and 100 | ||
*/ | ||
setVolume(volume: number): void; | ||
/** | ||
* @returns The player's current volume, an integer between 0 and 100 | ||
*/ | ||
getVolume(): number; | ||
/** | ||
* setSize sets the size in pixels of the <iframe> that contains the player | ||
* | ||
* @param width Width in pixels of the <iframe> | ||
* @param height Height in pixels of the <iframe> | ||
*/ | ||
setSize(width: number, height: number): void; | ||
/** | ||
* @returns Playback rate of the currently playing video | ||
*/ | ||
getPlaybackRate(): number; | ||
/** | ||
* setPlaybackRate sets the suggested playback rate for the current video | ||
* | ||
* @param suggestedRate Suggested playback rate | ||
*/ | ||
setPlaybackRate(suggestedRate: number): void; | ||
/** | ||
* @returns Available playback rates for the current video | ||
*/ | ||
getAvailablePlaybackRates(): number[]; | ||
/** | ||
* setLoop sets whether the player should continuously play a playlist | ||
* | ||
* @param loopPlaylists Whether to continuously loop playlists | ||
*/ | ||
setLoop(loopPlaylists: boolean): void; | ||
/** | ||
* setShuffle sets whether a playlist's videos should be shuffled | ||
* | ||
* @param shufflePlaylist Whether to shuffle playlist videos | ||
*/ | ||
setShuffle(shufflePlaylist: boolean): void; | ||
/** | ||
* @returns A number between 0 and 1 of how much the player has buffered | ||
*/ | ||
getVideoLoadedFraction(): number; | ||
/** | ||
* @returns Current player state | ||
*/ | ||
getPlayerState(): PlayerState; | ||
/** | ||
* @returns Elapsed time in seconds since the video started playing | ||
*/ | ||
getCurrentTime(): number; | ||
/** | ||
* @returns Actual video quality of the current video | ||
*/ | ||
getPlaybackQuality(): VideoQuality; | ||
/** | ||
* setPlaybackQuality sets the suggested video quality for the current video | ||
* | ||
* @param suggestedQuality Suggested video quality for the current video | ||
*/ | ||
setPlaybackQuality(suggestedQuality: VideoQuality): void; | ||
/** | ||
* @returns Quality formats in which the current video is available | ||
*/ | ||
getAvailableQualityLevels(): VideoQuality[]; | ||
/** | ||
* @returns Duration in seconds of the currently playing video | ||
*/ | ||
getDuration(): number; | ||
/** | ||
* @returns YouTube.com URL for the currently loaded/playing video | ||
*/ | ||
getVideoUrl(): string; | ||
/** | ||
* @returns The spherical video config object, with information about the viewport headings and zoom level | ||
*/ | ||
getSphericalProperties(): SphericalProperties; | ||
/** | ||
* setSphericalProperties sets the spherical video config object. The call will be No-Op for non-360 videos, and will | ||
* change the view port according to the input for 360 videos | ||
* | ||
* @param properties Spherical video config object | ||
*/ | ||
setSphericalProperties(properties: SphericalProperties): void; | ||
/** | ||
* @returns Embed code for the currently loaded/playing video | ||
*/ | ||
getVideoEmbedCode(): string; | ||
/** | ||
* @returns Video IDs in the playlist as they are currently ordered | ||
*/ | ||
getPlaylist(): string[]; | ||
/** | ||
* @returns Index of the playlist video that is currently playing | ||
*/ | ||
getPlaylistIndex(): number; | ||
/** | ||
* addEventListener adds an event listener for the specified event | ||
* | ||
* @param eventName Name of the event | ||
* @param listener Handler for the event | ||
*/ | ||
addEventListener<T extends PlayerEvent>(eventName: keyof Events, listener: (event: T) => void): void; | ||
/** | ||
* removeEventListener remove an event listener for the specified event | ||
* | ||
* @param eventName Name of the event | ||
* @param listener Handler for the event | ||
*/ | ||
removeEventListener<TEvent extends PlayerEvent>(eventName: keyof Events, listener: (event: TEvent) => void): void; | ||
/** | ||
* @returns The DOM node for the embedded <iframe> | ||
*/ | ||
getIframe(): HTMLIFrameElement; | ||
/** | ||
* Removes the <iframe> containing the player | ||
*/ | ||
destroy(): void; | ||
} | ||
/** | ||
* @see https://developers.google.com/youtube/iframe_api_reference#onError | ||
*/ | ||
export declare enum PlayerError { | ||
INVALID_PARAMETER = 2, | ||
HTML5_ERROR = 5, | ||
NOT_FOUND = 100, | ||
NOT_ALLOWED = 101, | ||
NOT_ALLOWED_DISGUISE = 150 | ||
} | ||
export declare interface PlayerEvent { | ||
target: Player; | ||
} | ||
export declare interface PlayerEventCallback<T extends PlayerEvent> { | ||
(event: T): void; | ||
} | ||
export declare interface PlayerOptions { | ||
width?: string | number | undefined; | ||
height?: string | number | undefined; | ||
videoId?: string | undefined; | ||
playerVars?: PlayerVars | undefined; | ||
events?: Events | undefined; | ||
host?: string | undefined; | ||
} | ||
/** | ||
* @see https://developers.google.com/youtube/iframe_api_reference#onStateChange | ||
*/ | ||
export declare enum PlayerState { | ||
UNSTARTED = -1, | ||
ENDED = 0, | ||
PLAYING = 1, | ||
PAUSED = 2, | ||
BUFFERING = 3, | ||
VIDEO_CUED = 5 | ||
} | ||
export declare type PlayerStateChangeCallback = PlayerEventCallback<PlayerStateChangeEvent>; | ||
export declare interface PlayerStateChangeEvent extends PlayerEvent { | ||
data: PlayerState; | ||
} | ||
export declare interface PlayerVars { | ||
autohide?: AutohideOption | undefined; | ||
autoplay?: AutoplayOption | undefined; | ||
cc_load_policy?: CCLoadPolicyOption | undefined; | ||
cc_lang_pref?: string | undefined; | ||
color?: ProgressBarColor | undefined; | ||
controls?: ControlsOption | undefined; | ||
disablekb?: KeyboardOptions | undefined; | ||
enablejsapi?: JSAPIOptions | undefined; | ||
end?: number | undefined; | ||
fs?: FullscreenOption | undefined; | ||
hl?: string | undefined; | ||
iv_load_policy?: IVPolicyOption | undefined; | ||
list?: string | undefined; | ||
listType?: ListType | undefined; | ||
loop?: LoopOption | undefined; | ||
/** | ||
* The `modestbranding` parameter is deprecated and will have no effect. To align with YouTube's branding | ||
* requirements, the player now determines the appropriate branding treatment based on a combination of factors, | ||
* including player size, other API parameters (e.g. controls), and additional signals. | ||
* | ||
* @see https://developers.google.com/youtube/player_parameters#august-15,-2023 | ||
* @deprecated | ||
*/ | ||
modestbranding?: ModestBrandingOption | undefined; | ||
mute?: MuteOption | undefined; | ||
origin?: string | undefined; | ||
playlist?: string | undefined; | ||
playsinline?: PlaysInlineOption | undefined; | ||
rel?: RelatedVideosOption | undefined; | ||
showinfo?: ShowInfoOption | undefined; | ||
start?: number | undefined; | ||
} | ||
export declare interface PlaylistSettings extends VideoOrPlaylistSettings { | ||
list: string; | ||
listType?: ListType | undefined; | ||
index?: number | undefined; | ||
} | ||
export declare type PlaysInlineOption = 0 | 1; | ||
export declare type ProgressBarColor = 'red' | 'white'; | ||
export declare const PROVIDE_KEY = "vue-youtube"; | ||
export declare type ReadyCallback = PlayerEventCallback<PlayerEvent>; | ||
export declare type RelatedVideosOption = 0 | 1; | ||
export declare type ShowInfoOption = 0 | 1; | ||
export declare interface SphericalProperties { | ||
enableOrientationSensor?: boolean | undefined; | ||
fov?: number | undefined; | ||
pitch?: number | undefined; | ||
roll?: number | undefined; | ||
yaw?: number | undefined; | ||
} | ||
export declare function unrefElement(ref: MaybeElementRef): HTMLElement | undefined; | ||
export declare interface VideoByIdSettings extends VideoOrPlaylistSettings { | ||
videoId: string; | ||
} | ||
export declare interface VideoByMediaContentUrlSettings extends VideoOrPlaylistSettings { | ||
mediaContentUrl: string; | ||
} | ||
export declare interface VideoOrPlaylistSettings { | ||
startSeconds?: number | undefined; | ||
endSeconds?: number | undefined; | ||
suggestedQuality?: VideoQuality | undefined; | ||
} | ||
/** | ||
* @see https://developers.google.com/youtube/iframe_api_reference#onPlaybackQualityChange | ||
*/ | ||
export declare type VideoQuality = (VideoQualityDefault | VideoQualitySmall | VideoQualityMedium | VideoQualityLarge | VideoQualityHD720 | VideoQualityHD1080 | VideoQualityHighres); | ||
/** | ||
* Default video quality YouTube chooses. | ||
*/ | ||
export declare type VideoQualityDefault = 'default'; | ||
/** | ||
* The video dimensions are at least 1920px by 1080px (16:9) or 1440px by 1080px (4:3). | ||
*/ | ||
export declare type VideoQualityHD1080 = 'hd1080'; | ||
/** | ||
* The video dimensions are at least 1280px by 720px (16:9) or 960px by 720px (4:3). | ||
*/ | ||
export declare type VideoQualityHD720 = 'hd720'; | ||
/** | ||
* The video height is bigger than 1080px. | ||
*/ | ||
export declare type VideoQualityHighres = 'highres'; | ||
/** | ||
* The video dimensions are at least 853px by 480px (16:9) or 640px by 480px (4:3). | ||
*/ | ||
export declare type VideoQualityLarge = 'large'; | ||
/** | ||
* The video dimensions are at least 640px by 360px (16:9) or 480px by 360px (4:3). | ||
*/ | ||
export declare type VideoQualityMedium = 'medium'; | ||
/** | ||
* The video dimensions are at least 320px by 240px with a 4:3 aspect ratio. | ||
*/ | ||
export declare type VideoQualitySmall = 'small'; | ||
export { } |
{ | ||
"name": "@vue-youtube/shared", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"description": "Shared code for VueYoutube", | ||
@@ -5,0 +5,0 @@ "author": "Techassi <git@techassi.dev>", |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
21269
6
461
1