Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
@eduardoroth/media-player
Advanced tools
Native Media Player for iOS, Android and Browser. Based on the great work of @jepiqueau
npm install @eduardoroth/media-player
npx cap sync
For the plugin to work correctly, you have to set/add in your AndroidManifest.xml
for your main activity the following setting for android:configChanges
<activity
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|screenLayout|uiMode|fontScale|density|fontWeightAdjustment"
>
</activity>
This will make sure the app doesn't break when doing any of the following actions:
create(...)
play(...)
pause(...)
getDuration(...)
getCurrentTime(...)
setCurrentTime(...)
isPlaying(...)
isMuted(...)
setVisibilityBackgroundForPiP(...)
mute(...)
getVolume(...)
setVolume(...)
getRate(...)
setRate(...)
remove(...)
removeAll()
addListener('MediaPlayer:Ready', ...)
addListener('MediaPlayer:Play', ...)
addListener('MediaPlayer:Pause', ...)
addListener('MediaPlayer:Ended', ...)
addListener('MediaPlayer:Removed', ...)
addListener('MediaPlayer:Seek', ...)
addListener('MediaPlayer:TimeUpdated', ...)
addListener('MediaPlayer:FullScreen', ...)
addListener('MediaPlayer:PictureInPicture', ...)
addListener('MediaPlayer:isPlayingInBackground', ...)
removeAllListeners(...)
create(options: MediaPlayerOptions) => Promise<MediaPlayerResult<string>>
Param | Type |
---|---|
options | MediaPlayerOptions |
Returns: Promise<MediaPlayerResult<string>>
play(options: MediaPlayerIdOptions) => Promise<MediaPlayerResult<string>>
Param | Type |
---|---|
options | MediaPlayerIdOptions |
Returns: Promise<MediaPlayerResult<string>>
pause(options: MediaPlayerIdOptions) => Promise<MediaPlayerResult<string>>
Param | Type |
---|---|
options | MediaPlayerIdOptions |
Returns: Promise<MediaPlayerResult<string>>
getDuration(options: MediaPlayerIdOptions) => Promise<MediaPlayerResult<number>>
Param | Type |
---|---|
options | MediaPlayerIdOptions |
Returns: Promise<MediaPlayerResult<number>>
getCurrentTime(options: MediaPlayerIdOptions) => Promise<MediaPlayerResult<number>>
Param | Type |
---|---|
options | MediaPlayerIdOptions |
Returns: Promise<MediaPlayerResult<number>>
setCurrentTime(options: MediaPlayerSetCurrentTimeOptions) => Promise<MediaPlayerResult<number>>
Param | Type |
---|---|
options | MediaPlayerSetCurrentTimeOptions |
Returns: Promise<MediaPlayerResult<number>>
isPlaying(options: MediaPlayerIdOptions) => Promise<MediaPlayerResult<boolean>>
Param | Type |
---|---|
options | MediaPlayerIdOptions |
Returns: Promise<MediaPlayerResult<boolean>>
isMuted(options: MediaPlayerIdOptions) => Promise<MediaPlayerResult<boolean>>
Param | Type |
---|---|
options | MediaPlayerIdOptions |
Returns: Promise<MediaPlayerResult<boolean>>
setVisibilityBackgroundForPiP(options: MediaPlayerSetVisibilityBackgroundForPiPOptions) => Promise<MediaPlayerResult<boolean>>
Param | Type |
---|---|
options | MediaPlayerSetVisibilityBackgroundForPiPOptions |
Returns: Promise<MediaPlayerResult<boolean>>
mute(options: MediaPlayerIdOptions) => Promise<MediaPlayerResult<boolean>>
Param | Type |
---|---|
options | MediaPlayerIdOptions |
Returns: Promise<MediaPlayerResult<boolean>>
getVolume(options: MediaPlayerIdOptions) => Promise<MediaPlayerResult<number>>
Param | Type |
---|---|
options | MediaPlayerIdOptions |
Returns: Promise<MediaPlayerResult<number>>
setVolume(options: MediaPlayerSetVolumeOptions) => Promise<MediaPlayerResult<number>>
Param | Type |
---|---|
options | MediaPlayerSetVolumeOptions |
Returns: Promise<MediaPlayerResult<number>>
getRate(options: MediaPlayerIdOptions) => Promise<MediaPlayerResult<number>>
Param | Type |
---|---|
options | MediaPlayerIdOptions |
Returns: Promise<MediaPlayerResult<number>>
setRate(options: MediaPlayerSetRateOptions) => Promise<MediaPlayerResult<number>>
Param | Type |
---|---|
options | MediaPlayerSetRateOptions |
Returns: Promise<MediaPlayerResult<number>>
remove(options: MediaPlayerIdOptions) => Promise<MediaPlayerResult<string>>
Param | Type |
---|---|
options | MediaPlayerIdOptions |
Returns: Promise<MediaPlayerResult<string>>
removeAll() => Promise<MediaPlayerResult<string[]>>
Returns: Promise<MediaPlayerResult<string[]>>
addListener(event: 'MediaPlayer:Ready', listener: (event: { playerId: string; }) => void) => Promise<PluginListenerHandle>
Param | Type |
---|---|
event | 'MediaPlayer:Ready' |
listener | (event: { playerId: string; }) => void |
Returns: Promise<PluginListenerHandle>
addListener(event: 'MediaPlayer:Play', listener: (event: { playerId: string; }) => void) => Promise<PluginListenerHandle>
Param | Type |
---|---|
event | 'MediaPlayer:Play' |
listener | (event: { playerId: string; }) => void |
Returns: Promise<PluginListenerHandle>
addListener(event: 'MediaPlayer:Pause', listener: (event: { playerId: string; }) => void) => Promise<PluginListenerHandle>
Param | Type |
---|---|
event | 'MediaPlayer:Pause' |
listener | (event: { playerId: string; }) => void |
Returns: Promise<PluginListenerHandle>
addListener(event: 'MediaPlayer:Ended', listener: (event: { playerId: string; }) => void) => Promise<PluginListenerHandle>
Param | Type |
---|---|
event | 'MediaPlayer:Ended' |
listener | (event: { playerId: string; }) => void |
Returns: Promise<PluginListenerHandle>
addListener(event: 'MediaPlayer:Removed', listener: (event: { playerId: string; }) => void) => Promise<PluginListenerHandle>
Param | Type |
---|---|
event | 'MediaPlayer:Removed' |
listener | (event: { playerId: string; }) => void |
Returns: Promise<PluginListenerHandle>
addListener(event: 'MediaPlayer:Seek', listener: (event: { playerId: string; previousTime: number | undefined; newTime: number; }) => void) => Promise<PluginListenerHandle>
Param | Type |
---|---|
event | 'MediaPlayer:Seek' |
listener | (event: { playerId: string; previousTime: number; newTime: number; }) => void |
Returns: Promise<PluginListenerHandle>
addListener(event: 'MediaPlayer:TimeUpdated', listener: (event: { playerId: string; currentTime: number; }) => void) => Promise<PluginListenerHandle>
Param | Type |
---|---|
event | 'MediaPlayer:TimeUpdated' |
listener | (event: { playerId: string; currentTime: number; }) => void |
Returns: Promise<PluginListenerHandle>
addListener(event: 'MediaPlayer:FullScreen', listener: (event: { playerId: string; isInFullScreen: boolean; }) => void) => Promise<PluginListenerHandle>
Param | Type |
---|---|
event | 'MediaPlayer:FullScreen' |
listener | (event: { playerId: string; isInFullScreen: boolean; }) => void |
Returns: Promise<PluginListenerHandle>
addListener(event: 'MediaPlayer:PictureInPicture', listener: (event: { playerId: string; isInPictureInPicture: boolean; }) => void) => Promise<PluginListenerHandle>
Param | Type |
---|---|
event | 'MediaPlayer:PictureInPicture' |
listener | (event: { playerId: string; isInPictureInPicture: boolean; }) => void |
Returns: Promise<PluginListenerHandle>
addListener(event: 'MediaPlayer:isPlayingInBackground', listener: (event: { playerId: string; isPlayingInBackground: boolean; }) => void) => Promise<PluginListenerHandle>
Param | Type |
---|---|
event | 'MediaPlayer:isPlayingInBackground' |
listener | (event: { playerId: string; isPlayingInBackground: boolean; }) => void |
Returns: Promise<PluginListenerHandle>
removeAllListeners(options: MediaPlayerIdOptions) => Promise<void>
Param | Type |
---|---|
options | MediaPlayerIdOptions |
Prop | Type |
---|---|
name | string |
message | string |
stack | string |
Prop | Type |
---|---|
remove | () => Promise<void> |
{ method: string; result: boolean; value?: ResultValueType; error?: Error; message?: string; }
{ playerId: string; url: string; placement?: MediaPlayerPlacementOptions; ios?: MediaPlayerIosOptions; android?: MediaPlayerAndroidOptions; web?: MediaPlayerWebOptions; extra?: MediaPlayerExtraOptions; }
{ videoOrientation?: 'VERTICAL' | 'HORIZONTAL'; horizontalMargin?: number; horizontalAlignment?: 'START' | 'CENTER' | 'END'; verticalMargin?: number; verticalAlignment?: 'TOP' | 'CENTER' | 'BOTTOM'; height?: number; width?: number; }
{ enableExternalPlayback?: boolean; enablePiP?: boolean; enableBackgroundPlay?: boolean; openInFullscreen?: boolean; automaticallyEnterPiP?: boolean; automaticallyHideBackgroundForPip?: boolean; fullscreenOnLandscape?: boolean; allowsVideoFrameAnalysis?: boolean; }
{ enableChromecast?: boolean; enablePiP?: boolean; enableBackgroundPlay?: boolean; openInFullscreen?: boolean; automaticallyEnterPiP?: boolean; fullscreenOnLandscape?: boolean; stopOnTaskRemoved?: boolean; }
{ enableChromecast?: boolean; }
{ title?: string; subtitle?: string; poster?: string; artist?: string; rate?: number; subtitles?: MediaPlayerSubtitleOptions; autoPlayWhenReady?: boolean; loopOnEnd?: boolean; showControls?: boolean; headers?: { [key: string]: string; }; }
{ url: string; options?: { language?: string; foregroundColor?: string; backgroundColor?: string; fontSize?: number; }; }
{ playerId: string; }
{ playerId: string; time: number; }
{ playerId: string; isVisible: boolean; }
{ playerId: string; volume: number; }
{ playerId: string; rate: number; }
FAQs
Updated Media Player for iOS, Android and Web
The npm package @eduardoroth/media-player receives a total of 60 weekly downloads. As such, @eduardoroth/media-player popularity was classified as not popular.
We found that @eduardoroth/media-player demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.