Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
    • Yandex Cloud Partner program
  • Blog
  • Pricing
  • Documentation
© 2025 Direct Cursus Technology L.L.C.
Yandex Cloud Video
    • Overview
    • Control
    • Troubleshooting
      • Overview
      • IFrame
      • iOS
        • Getting started
        • Player initialization parameters
        • Player methods
        • Player state
        • Player events
          • Modules
            • PlayerSdkApi
            • PlayerSdkEventHandlers
            • PlayerSdkInitConfig
            • PlayerSdkSourceParams
            • PlayerSdkState
  • Access management
  • Pricing policy
  • Audit Trails events
  • Release notes

In this article:

  • Methods
  • destroy
  • getState
  • off
  • on
  • once
  • pause
  • play
  • seek
  • setMuted
  • setSource
  • setVolume
  1. Video Player
  2. SDK
  3. JavaScript
  4. API reference
  5. Interfaces
  6. PlayerSdkApi

Interface: PlayerSdkApi

Written by
Yandex Cloud
Updated at October 9, 2024
  • Methods
    • destroy
    • getState
    • off
    • on
    • once
    • pause
    • play
    • seek
    • setMuted
    • setSource
    • setVolume

PlayerSdk interface.

MethodsMethods

  • destroy
  • getState
  • off
  • on
  • once
  • pause
  • play
  • seek
  • setMuted
  • setSource
  • setVolume

destroydestroy

▸ destroy(): Promise<void>

Destroys the player and frees up the resources it uses.

Returns

Promise<void>

Promise that switches to the fulfilled state once the player is deleted.

getStategetState

▸ getState(): PlayerSdkState

Returns the state of PlayerSdk.

Returns

PlayerSdkState

offoff

▸ off<EventName>(eventName, handler): void

Unsubscribes from a player event.

Type parameters

Name Type
EventName extends PlayerSdkEvents

Parameters

Name Type Description
eventName EventName Event name
handler PlayerSdkEventHandlers[EventName] Event handler

Returns

void

onon

▸ on<EventName>(eventName, handler): void

Subscribes to a player event.

Type parameters

Name Type
EventName extends PlayerSdkEvents

Parameters

Name Type Description
eventName EventName Event name
handler PlayerSdkEventHandlers[EventName] Event handler

Returns

void

onceonce

▸ once<EventName>(eventName, handler): void

Subscribes to a single-time triggering of a player event.

Type parameters

Name Type
EventName extends PlayerSdkEvents

Parameters

Name Type Description
eventName EventName Event name
handler PlayerSdkEventHandlers[EventName] Event handler

Returns

void

pausepause

▸ pause(): void

Pauses playback.

Returns

void

playplay

▸ play(): Promise<void>

Starts video playback.

Returns

Promise<void>

Promise that switches to the fulfilled state once the video playback starts.

seekseek

▸ seek(time): void

Rewinds or fast forward a video to a specific position.

Parameters

Name Type Description
time Seconds Time in seconds

Returns

void

setMutedsetMuted

▸ setMuted(muted): void

Mutes/unmutes a video.

Parameters

Name Type Description
muted boolean True to mute, false to unmute

Returns

void

setSourcesetSource

▸ setSource(sourceConfig): Promise<void>

Sets the video source.

Parameters

Name Type Description
sourceConfig PlayerSdkSourceConfig Video source to switch to and its parameters

Returns

Promise<void>

Promise that switches to the fulfilled state once the main player resources are freed up.

setVolumesetVolume

▸ setVolume(volume): void

Sets the sound volume of a video.

Parameters

Name Type Description
volume Volume Video volume from 0 (muted) to 1 (maximum volume)

Returns

void

Was the article helpful?

Previous
PlayerSdkStatus
Next
PlayerSdkEventHandlers
© 2025 Direct Cursus Technology L.L.C.