Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@eduardoroth/media-player

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@eduardoroth/media-player

Updated Media Player for iOS, Android and Web

  • 1.2.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
348
increased by894.29%
Maintainers
1
Weekly downloads
 
Created
Source

@eduardoroth/media-player

Native Media Player for iOS, Android and Browser. Based on the great work of @jepiqueau

Install

npm install @eduardoroth/media-player
npx cap sync

API

create(...)

create(options: MediaPlayerOptions) => Promise<MediaPlayerResult<string>>
ParamType
optionsMediaPlayerOptions

Returns: Promise<MediaPlayerResult<string>>


play(...)

play(options: MediaPlayerIdOptions) => Promise<MediaPlayerResult<string>>
ParamType
optionsMediaPlayerIdOptions

Returns: Promise<MediaPlayerResult<string>>


pause(...)

pause(options: MediaPlayerIdOptions) => Promise<MediaPlayerResult<string>>
ParamType
optionsMediaPlayerIdOptions

Returns: Promise<MediaPlayerResult<string>>


getDuration(...)

getDuration(options: MediaPlayerIdOptions) => Promise<MediaPlayerResult<number>>
ParamType
optionsMediaPlayerIdOptions

Returns: Promise<MediaPlayerResult<number>>


getCurrentTime(...)

getCurrentTime(options: MediaPlayerIdOptions) => Promise<MediaPlayerResult<number>>
ParamType
optionsMediaPlayerIdOptions

Returns: Promise<MediaPlayerResult<number>>


setCurrentTime(...)

setCurrentTime(options: MediaPlayerSetCurrentTimeOptions) => Promise<MediaPlayerResult<number>>
ParamType
optionsMediaPlayerSetCurrentTimeOptions

Returns: Promise<MediaPlayerResult<number>>


isPlaying(...)

isPlaying(options: MediaPlayerIdOptions) => Promise<MediaPlayerResult<boolean>>
ParamType
optionsMediaPlayerIdOptions

Returns: Promise<MediaPlayerResult<boolean>>


isMuted(...)

isMuted(options: MediaPlayerIdOptions) => Promise<MediaPlayerResult<boolean>>
ParamType
optionsMediaPlayerIdOptions

Returns: Promise<MediaPlayerResult<boolean>>


mute(...)

mute(options: MediaPlayerIdOptions) => Promise<MediaPlayerResult<boolean>>
ParamType
optionsMediaPlayerIdOptions

Returns: Promise<MediaPlayerResult<boolean>>


getVolume(...)

getVolume(options: MediaPlayerIdOptions) => Promise<MediaPlayerResult<number>>
ParamType
optionsMediaPlayerIdOptions

Returns: Promise<MediaPlayerResult<number>>


setVolume(...)

setVolume(options: MediaPlayerSetVolumeOptions) => Promise<MediaPlayerResult<number>>
ParamType
optionsMediaPlayerSetVolumeOptions

Returns: Promise<MediaPlayerResult<number>>


getRate(...)

getRate(options: MediaPlayerIdOptions) => Promise<MediaPlayerResult<number>>
ParamType
optionsMediaPlayerIdOptions

Returns: Promise<MediaPlayerResult<number>>


setRate(...)

setRate(options: MediaPlayerSetRateOptions) => Promise<MediaPlayerResult<number>>
ParamType
optionsMediaPlayerSetRateOptions

Returns: Promise<MediaPlayerResult<number>>


remove(...)

remove(options: MediaPlayerIdOptions) => Promise<MediaPlayerResult<string>>
ParamType
optionsMediaPlayerIdOptions

Returns: Promise<MediaPlayerResult<string>>


removeAll()

removeAll() => Promise<MediaPlayerResult<string[]>>

Returns: Promise<MediaPlayerResult<string[]>>


addListener('MediaPlayer:Ready', ...)

addListener(event: 'MediaPlayer:Ready', listener: (event: { playerId: string; }) => void) => Promise<PluginListenerHandle>
ParamType
event'MediaPlayer:Ready'
listener(event: { playerId: string; }) => void

Returns: Promise<PluginListenerHandle>


addListener('MediaPlayer:Play', ...)

addListener(event: 'MediaPlayer:Play', listener: (event: { playerId: string; }) => void) => Promise<PluginListenerHandle>
ParamType
event'MediaPlayer:Play'
listener(event: { playerId: string; }) => void

Returns: Promise<PluginListenerHandle>


addListener('MediaPlayer:Pause', ...)

addListener(event: 'MediaPlayer:Pause', listener: (event: { playerId: string; }) => void) => Promise<PluginListenerHandle>
ParamType
event'MediaPlayer:Pause'
listener(event: { playerId: string; }) => void

Returns: Promise<PluginListenerHandle>


addListener('MediaPlayer:Ended', ...)

addListener(event: 'MediaPlayer:Ended', listener: (event: { playerId: string; }) => void) => Promise<PluginListenerHandle>
ParamType
event'MediaPlayer:Ended'
listener(event: { playerId: string; }) => void

Returns: Promise<PluginListenerHandle>


addListener('MediaPlayer:Removed', ...)

addListener(event: 'MediaPlayer:Removed', listener: (event: { playerId: string; }) => void) => Promise<PluginListenerHandle>
ParamType
event'MediaPlayer:Removed'
listener(event: { playerId: string; }) => void

Returns: Promise<PluginListenerHandle>


addListener('MediaPlayer:Seeked', ...)

addListener(event: 'MediaPlayer:Seeked', listener: (event: { playerId: string; previousTime: number | undefined; newTime: number; }) => void) => Promise<PluginListenerHandle>
ParamType
event'MediaPlayer:Seeked'
listener(event: { playerId: string; previousTime: number; newTime: number; }) => void

Returns: Promise<PluginListenerHandle>


addListener('MediaPlayer:TimeUpdate', ...)

addListener(event: 'MediaPlayer:TimeUpdate', listener: (event: { playerId: string; currentTime: number; }) => void) => Promise<PluginListenerHandle>
ParamType
event'MediaPlayer:TimeUpdate'
listener(event: { playerId: string; currentTime: number; }) => void

Returns: Promise<PluginListenerHandle>


addListener('MediaPlayer:FullScreen', ...)

addListener(event: 'MediaPlayer:FullScreen', listener: (event: { playerId: string; isInFullScreen: boolean; }) => void) => Promise<PluginListenerHandle>
ParamType
event'MediaPlayer:FullScreen'
listener(event: { playerId: string; isInFullScreen: boolean; }) => void

Returns: Promise<PluginListenerHandle>


addListener('MediaPlayer:PictureInPicture', ...)

addListener(event: 'MediaPlayer:PictureInPicture', listener: (event: { playerId: string; isInPictureInPicture: boolean; }) => void) => Promise<PluginListenerHandle>
ParamType
event'MediaPlayer:PictureInPicture'
listener(event: { playerId: string; isInPictureInPicture: boolean; }) => void

Returns: Promise<PluginListenerHandle>


removeAllListeners(...)

removeAllListeners(playerId: string) => Promise<void>
ParamType
playerIdstring

Interfaces

Error
PropType
namestring
messagestring
stackstring
PluginListenerHandle
PropType
remove() => Promise<void>

Type Aliases

MediaPlayerResult

{ method: string; result: boolean; value?: ResultValueType; error?: Error; message?: string; }

MediaPlayerOptions

{ playerId: string; url: string; ios?: MediaPlayerIosOptions; android?: MediaPlayerAndroidOptions; web?: MediaPlayerWebOptions; extra?: { title?: string; subtitle?: string; poster?: string; artist?: string; rate?: number; subtitles?: MediaPlayerSubtitleOptions; loopOnEnd?: boolean; showControls?: boolean; headers?: { [key: string]: string; }; }; }

MediaPlayerIosOptions

{ enableExternalPlayback?: boolean; enablePiP?: boolean; enableBackgroundPlay?: boolean; openInFullscreen?: boolean; automaticallyEnterPiP?: boolean; top?: number; left?: number; height?: number; width?: number; }

MediaPlayerAndroidOptions

{ enableChromecast?: boolean; enablePiP?: boolean; enableBackgroundPlay?: boolean; openInFullscreen?: boolean; automaticallyEnterPiP?: boolean; top?: number; left?: number; height?: number; width?: number; }

MediaPlayerWebOptions

{ enableChromecast?: boolean; }

MediaPlayerSubtitleOptions

{ url: string; options?: { language?: string; foregroundColor?: string; backgroundColor?: string; fontSize?: number; }; }

MediaPlayerIdOptions

{ playerId: string; }

MediaPlayerSetCurrentTimeOptions

{ playerId: string; time: number; }

MediaPlayerSetVolumeOptions

{ playerId: string; volume: number; }

MediaPlayerSetRateOptions

{ playerId: string; rate: number; }

Keywords

FAQs

Package last updated on 22 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc