import { Components, JSX } from '@vime/core'; interface VmPlayerProps { class?: string; style?: string; /** */ logger?: Components.VmPlayer["logger"]; /** This property has no role other than scoping CSS selectors. */ theme?: Components.VmPlayer["theme"]; /** The default icon library to be used throughout the player. You can use a predefined icon library such as vime, material, remix or boxicons. If you'd like to provide your own see the `` component. Remember to pass in the name of your icon library here. */ icons?: Components.VmPlayer["icons"]; /** Whether playback should be paused. Defaults to `true` if no media has loaded or playback has not started. Setting this to `true` will begin/resume playback. */ paused?: Components.VmPlayer["paused"]; /** Whether media is actively playing back. Defaults to `false` if no media has loaded or playback has not started. */ playing?: Components.VmPlayer["playing"]; /** A `double` indicating the total playback length of the media in seconds. Defaults to `-1` if no media has been loaded. If the media is being streamed live then the duration is equal to `Infinity`. */ duration?: Components.VmPlayer["duration"]; /** The title of the current media. Defaults to `undefined` if no media has been loaded. */ mediaTitle?: Components.VmPlayer["mediaTitle"]; /** The current provider name whose responsible for loading and playing media. Defaults to `undefined` when no provider has been loaded. */ currentProvider?: Components.VmPlayer["currentProvider"]; /** The absolute URL of the media resource that has been chosen. Defaults to `undefined` if no media has been loaded. */ currentSrc?: Components.VmPlayer["currentSrc"]; /** The absolute URL of the poster for the current media resource. Defaults to `undefined` if no media/poster has been loaded. */ currentPoster?: Components.VmPlayer["currentPoster"]; /** A `double` indicating the current playback time in seconds. Defaults to `0` if the media has not started to play and has not seeked. Setting this value seeks the media to the new time. The value can be set to a minimum of `0` and maximum of the total length of the media (indicated by the duration prop). */ currentTime?: Components.VmPlayer["currentTime"]; /** Whether playback should automatically begin playing once the media is ready to do so. This will only work if the browsers `autoplay` policies have been satisfied. It'll generally work if the player is muted, or the user frequently interacts with your site. You can check if it's possible to autoplay via the `canAutoplay()` or `canMutedAutoplay()` methods. Depending on the provider, changing this prop may cause the player to completely reset. */ autoplay?: Components.VmPlayer["autoplay"]; /** Whether the player has loaded and is ready to be interacted with. */ ready?: Components.VmPlayer["ready"]; /** Whether media is ready for playback to begin. */ playbackReady?: Components.VmPlayer["playbackReady"]; /** Whether media should automatically start playing from the beginning every time it ends. */ loop?: Components.VmPlayer["loop"]; /** Whether the audio is muted or not. */ muted?: Components.VmPlayer["muted"]; /** The length of the media in seconds that has been downloaded by the browser. */ buffered?: Components.VmPlayer["buffered"]; /** A `double` indicating the rate at which media is being played back. If the value is `<1` then playback is slowed down; if `>1` then playback is sped up. Defaults to `1`. The playback rate can only be set to a rate found in the `playbackRates` prop. Some providers may not allow changing the playback rate, you can check if it's possible via `canSetPlaybackRate()`. */ playbackRate?: Components.VmPlayer["playbackRate"]; /** The playback rates available for the current media. */ playbackRates?: Components.VmPlayer["playbackRates"]; /** Indicates the quality of the media. The value will differ between audio and video. For audio this might be some combination of the encoding format (AAC, MP3), bitrate in kilobits per second (kbps) and sample rate in kilohertz (kHZ). For video this will be the number of vertical pixels it supports. For example, if the video has a resolution of `1920x1080` then the quality will return `1080p`. Defaults to `undefined` which you can interpret as the quality is unknown. The value can also be `Auto` for adaptive bit streams (ABR), where the provider can automatically manage the playback quality. The quality can only be set to a quality found in the `playbackQualities` prop. Some providers may not allow changing the quality, you can check if it's possible via `canSetPlaybackQuality()`. */ playbackQuality?: Components.VmPlayer["playbackQuality"]; /** The media qualities available for the current media. */ playbackQualities?: Components.VmPlayer["playbackQualities"]; /** Whether the player is in the process of seeking to a new time position. */ seeking?: Components.VmPlayer["seeking"]; /** Whether the player is in debug mode and should `console.x` information about its internal state. */ debug?: Components.VmPlayer["debug"]; /** Whether the media has initiated playback. In other words it will be true if `currentTime > 0`. */ playbackStarted?: Components.VmPlayer["playbackStarted"]; /** Whether media playback has reached the end. In other words it'll be true if `currentTime === duration`. */ playbackEnded?: Components.VmPlayer["playbackEnded"]; /** Whether playback has temporarily stopped because of a lack of temporary data. */ buffering?: Components.VmPlayer["buffering"]; /** Indicates whether a user interface should be shown for controlling the resource. Set this to `false` when you want to provide your own custom controls, and `true` if you want the current provider to supply its own default controls. Depending on the provider, changing this prop may cause the player to completely reset. */ controls?: Components.VmPlayer["controls"]; /** Whether the controls are currently visible. This is currently only supported by custom controls. */ isControlsActive?: Components.VmPlayer["isControlsActive"]; /** Whether the settings menu has been opened and is currently visible. This is currently only supported by custom settings. */ isSettingsActive?: Components.VmPlayer["isSettingsActive"]; /** An `int` between `0` (silent) and `100` (loudest) indicating the audio volume. */ volume?: Components.VmPlayer["volume"]; /** Whether the player is currently in fullscreen mode. */ isFullscreenActive?: Components.VmPlayer["isFullscreenActive"]; /** The aspect ratio of the player expressed as `width:height` (`16:9`). This is only applied if the `viewType` is `video` and the player is not in fullscreen mode. */ aspectRatio?: Components.VmPlayer["aspectRatio"]; /** The type of player view that is being used, whether it's an audio player view or video player view. Normally if the media type is of audio then the view is of type audio, but in some cases it might be desirable to show a different view type. For example, when playing audio with a poster. This is subject to the provider allowing it. Defaults to `undefined` when no media has been loaded. */ viewType?: Components.VmPlayer["viewType"]; /** Whether the current view is of type `audio`, shorthand for `viewType === ViewType.Audio`. */ isAudioView?: Components.VmPlayer["isAudioView"]; /** Whether the current view is of type `video`, shorthand for `viewType === ViewType.Video`. */ isVideoView?: Components.VmPlayer["isVideoView"]; /** The type of media that is currently active, whether it's audio or video. Defaults to `undefined` when no media has been loaded or the type cannot be determined. */ mediaType?: Components.VmPlayer["mediaType"]; /** Whether the current media is of type `audio`, shorthand for `mediaType === MediaType.Audio`. */ isAudio?: Components.VmPlayer["isAudio"]; /** Whether the current media is of type `video`, shorthand for `mediaType === MediaType.Video`. */ isVideo?: Components.VmPlayer["isVideo"]; /** Whether the current media is being broadcast live (`duration === Infinity`). */ isLive?: Components.VmPlayer["isLive"]; /** Whether the player is in mobile mode. This is determined by parsing `window.navigator.userAgent`. */ isMobile?: Components.VmPlayer["isMobile"]; /** Whether the player is in touch mode. This is determined by listening for mouse/touch events and toggling this value. */ isTouch?: Components.VmPlayer["isTouch"]; /** Whether the player is currently in picture-in-picture mode. */ isPiPActive?: Components.VmPlayer["isPiPActive"]; /** The text tracks associated with the current media. */ textTracks?: Components.VmPlayer["textTracks"]; /** Gets the index of the currently active text track. Defaults to `-1` to when all text tracks are disabled. If you'd like to set it than see the `setCurrentTextTrack` method. */ currentTextTrack?: Components.VmPlayer["currentTextTrack"]; /** Whether the current text tracks is visible. If you'd like to set it than see the `setTrackTrackVisibility` method. */ isTextTrackVisible?: Components.VmPlayer["isTextTrackVisible"]; /** Whether text tracks should be rendered by native player, set to `false` if using custom display. */ shouldRenderNativeTextTracks?: Components.VmPlayer["shouldRenderNativeTextTracks"]; /** The audio tracks associated with the current media. */ audioTracks?: Components.VmPlayer["audioTracks"]; /** Gets the index of the currently active audio track. Defaults to `-1` to when the default audio track is used. If you'd like to set it than see the `setCurrentAudioTrack` method. */ currentAudioTrack?: Components.VmPlayer["currentAudioTrack"]; /** Whether the player should automatically pause when another Vime player starts/resumes playback. */ autopause?: Components.VmPlayer["autopause"]; /** Whether the video is to be played "inline", that is within the element's playback area. Note that setting this to false does not imply that the video will always be played in fullscreen. Depending on the provider, changing this prop may cause the player to completely reset. */ playsinline?: Components.VmPlayer["playsinline"]; /** The current language of the player. This can be any code defined via the `extendLanguage` method or the default `en`. It's recommended to use an ISO 639-1 code as that'll be used by Vime when adding new language defaults in the future. */ language?: Components.VmPlayer["language"]; /** Contains each language and its respective translation map. */ translations?: Components.VmPlayer["translations"]; /** The languages that are currently available. You can add new languages via the `extendLanguage` method. */ languages?: Components.VmPlayer["languages"]; /** A dictionary of translations for the current language. */ i18n?: Components.VmPlayer["i18n"]; } interface VmPlayerEvents { /** Emitted when the `theme` prop changes value. */ vmThemeChange: Parameters[0]; /** Emitted when the `paused` prop changes value. */ vmPausedChange: Parameters[0]; /** Emitted when the media is transitioning from `paused` to `playing`. Event flow: `paused` -> `play` -> `playing`. The media starts `playing` once enough content has buffered to begin/resume playback. */ vmPlay: Parameters[0]; /** Emitted when the `playing` prop changes value. */ vmPlayingChange: Parameters[0]; /** Emitted when the `seeking` prop changes value. */ vmSeekingChange: Parameters[0]; /** Emitted directly after the player has successfully transitioned/seeked to a new time position. Event flow: `seeking` -> `seeked`. */ vmSeeked: Parameters[0]; /** Emitted when the `buffering` prop changes value. */ vmBufferingChange: Parameters[0]; /** Emitted when the `duration` prop changes value. */ vmDurationChange: Parameters[0]; /** Emitted when the `currentTime` prop changes value. */ vmCurrentTimeChange: Parameters[0]; /** Emitted when the player has loaded and is ready to be interacted with. */ vmReady: Parameters[0]; /** Emitted when the media is ready to begin playback. The following props are guaranteed to be defined when this fires: `mediaTitle`, `currentSrc`, `currentPoster`, `duration`, `mediaType`, `viewType`. */ vmPlaybackReady: Parameters[0]; /** Emitted when the media initiates playback. */ vmPlaybackStarted: Parameters[0]; /** Emitted when playback reaches the end of the media. */ vmPlaybackEnded: Parameters[0]; /** Emitted when the `buffered` prop changes value. */ vmBufferedChange: Parameters[0]; /** Emitted when an any error has occurred within the player. */ vmError: Parameters[0]; /** Emitted when the provider starts loading a media resource. */ vmLoadStart: Parameters[0]; /** Emitted when the `currentProvider` prop changes value. */ vmCurrentProviderChange: Parameters[0]; /** Emitted when the `currentSrc` prop changes value. */ vmCurrentSrcChange: Parameters[0]; /** Emitted when the `currentPoster` prop changes value. */ vmCurrentPosterChange: Parameters[0]; /** Emitted when the `mediaTitle` prop changes value. */ vmMediaTitleChange: Parameters[0]; /** Emitted when the `isControlsActive` prop changes value. */ vmControlsChange: Parameters[0]; /** Emitted when the `playbackRate` prop changes value. */ vmPlaybackRateChange: Parameters[0]; /** Emitted when the `playbackRates` prop changes value. */ vmPlaybackRatesChange: Parameters[0]; /** Emitted when the `playbackQuality` prop changes value. */ vmPlaybackQualityChange: Parameters[0]; /** Emitted when the `playbackQualities` prop changes value. */ vmPlaybackQualitiesChange: Parameters[0]; /** Emitted when the `muted` prop changes value. */ vmMutedChange: Parameters[0]; /** Emitted when the `volume` prop changes value. */ vmVolumeChange: Parameters[0]; /** Emitted when the `viewType` prop changes value. */ vmViewTypeChange: Parameters[0]; /** Emitted when the `mediaType` prop changes value. */ vmMediaTypeChange: Parameters[0]; /** Emitted when the `isLive` prop changes value. */ vmLiveChange: Parameters[0]; /** Emitted when the `isTouch` prop changes value. */ vmTouchChange: Parameters[0]; /** Emitted when the `language` prop changes value. */ vmLanguageChange: Parameters[0]; /** Emitted when the `i18n` prop changes value. */ vmI18nChange: Parameters[0]; /** Emitted when the `translations` prop changes value. */ vmTranslationsChange: Parameters[0]; /** Emitted when the `languages` prop changes value. */ vmLanguagesChange: Parameters[0]; /** Emitted when the `isFullscreenActive` prop changes value. */ vmFullscreenChange: Parameters[0]; /** Emitted when the `isPiPActive` prop changes value. */ vmPiPChange: Parameters[0]; /** Emitted when the `textTracks` prop changes value. */ vmTextTracksChange: Parameters[0]; /** Emitted when the `currentTextTrack` prop changes value. */ vmCurrentTextTrackChange: Parameters[0]; /** Emitted when the `isTextTrackVisible` prop changes value. */ vmTextTrackVisibleChange: Parameters[0]; /** Emitted when the `audioTracks` prop changes value. */ vmAudioTracksChange: Parameters[0]; /** Emitted when the `currentAudioTrack` prop changes value. */ vmCurrentAudioTrackChange: Parameters[0]; } interface VmPlayerSlots { default: any; } import { SvelteComponent } from "svelte/internal"; declare class Player extends SvelteComponent { $$prop_def: VmPlayerProps; $$events_def: VmPlayerEvents; $$slot_def: VmPlayerSlots; $on(type: K, callback: (e: VmPlayerEvents[K]) => any): () => void; $set($$props: Partial): void; constructor(options: any); /** Returns the current media provider. */ get getProvider(): Components.VmPlayer["getProvider"]; /** Returns the current media provider's adapter. Shorthand for `getProvider().getAdapter()`. */ get getAdapter(): Components.VmPlayer["getAdapter"]; /** Begins/resumes playback of the media. If this method is called programmatically before the user has interacted with the player, the promise may be rejected subject to the browser's autoplay policies. */ get play(): Components.VmPlayer["play"]; /** Pauses playback of the media. */ get pause(): Components.VmPlayer["pause"]; /** Determines whether the current provider recognizes, and can play the given type. */ get canPlay(): Components.VmPlayer["canPlay"]; /** Determines whether the player can start playback of the current media automatically. */ get canAutoplay(): Components.VmPlayer["canAutoplay"]; /** Determines whether the player can start playback of the current media automatically given the player is muted. */ get canMutedAutoplay(): Components.VmPlayer["canMutedAutoplay"]; /** Returns whether the current provider allows setting the `playbackRate` prop. */ get canSetPlaybackRate(): Components.VmPlayer["canSetPlaybackRate"]; /** Returns whether the current provider allows setting the `playbackQuality` prop. */ get canSetPlaybackQuality(): Components.VmPlayer["canSetPlaybackQuality"]; /** Returns whether the native browser fullscreen API is available, or the current provider can toggle fullscreen mode. This does not mean that the operation is guaranteed to be successful, only that it can be attempted. */ get canSetFullscreen(): Components.VmPlayer["canSetFullscreen"]; /** Requests to enter fullscreen mode, returning a `Promise` that will resolve if the request is made, or reject with a reason for failure. This method will first attempt to use the browsers native fullscreen API, and then fallback to requesting the provider to do it (if available). Do not rely on a resolved promise to determine if the player is in fullscreen or not. The only way to be certain is by listening to the `vmFullscreenChange` event. Some common reasons for failure are: the fullscreen API is not available, the request is made when `viewType` is audio, or the user has not interacted with the page yet. */ get enterFullscreen(): Components.VmPlayer["enterFullscreen"]; /** Requests to exit fullscreen mode, returning a `Promise` that will resolve if the request is successful, or reject with a reason for failure. Refer to `enterFullscreen()` for more information. */ get exitFullscreen(): Components.VmPlayer["exitFullscreen"]; /** Returns whether the current provider exposes an API for entering and exiting picture-in-picture mode. This does not mean the operation is guaranteed to be successful, only that it can be attempted. */ get canSetPiP(): Components.VmPlayer["canSetPiP"]; /** Request to enter picture-in-picture (PiP) mode, returning a `Promise` that will resolve if the request is made, or reject with a reason for failure. Do not rely on a resolved promise to determine if the player is in PiP mode or not. The only way to be certain is by listening to the `vmPiPChange` event. Some common reasons for failure are the same as the reasons for `enterFullscreen()`. */ get enterPiP(): Components.VmPlayer["enterPiP"]; /** Request to exit picture-in-picture mode, returns a `Promise` that will resolve if the request is successful, or reject with a reason for failure. Refer to `enterPiP()` for more information. */ get exitPiP(): Components.VmPlayer["exitPiP"]; /** Returns whether the current providers allows changing the audio track. */ get canSetAudioTrack(): Components.VmPlayer["canSetAudioTrack"]; /** Sets the currently active audio track given the index. */ get setCurrentAudioTrack(): Components.VmPlayer["setCurrentAudioTrack"]; /** Returns whether the current provider allows changing the text track. */ get canSetTextTrack(): Components.VmPlayer["canSetTextTrack"]; /** Sets the currently active text track given the index. Set to -1 to disable all text tracks. */ get setCurrentTextTrack(): Components.VmPlayer["setCurrentTextTrack"]; /** Returns whether the current providers allows setting the text track visibility. */ get canSetTextTrackVisibility(): Components.VmPlayer["canSetTextTrackVisibility"]; /** Sets the visibility of the currently active text track. */ get setTextTrackVisibility(): Components.VmPlayer["setTextTrackVisibility"]; /** Extends the translation map for a given language. */ get extendLanguage(): Components.VmPlayer["extendLanguage"]; /** Returns the inner container. */ get getContainer(): Components.VmPlayer["getContainer"]; /** */ get callAdapter(): Components.VmPlayer["callAdapter"]; get ref(): any; get getWebComponent(): HTMLVmPlayerElement | undefined; } export default Player;