MediaPlayer

Table of contents

Interface description

Inherit methods from View

CurrentTime() float64

Returns the current playback time in seconds.

Duration() float64

Returns the value indicating the total duration of the media in seconds. If no media data is available, the returned value is NaN.

IsEnded() bool

Function tells whether the media element is ended.

IsPaused() bool

Function tells whether the media element is paused.

Pause()

Pause playback of the media, if the media is already in a paused state this method will have no effect.

Play()

Attempts to begin playback of the media.

PlaybackRate() float64

Returns the rate at which the media is being played back.

SetCurrentTime(seconds float64)

Sets the current playback time in seconds.

SetPlaybackRate(rate float64)

Sets the rate at which the media is being played back. This is used to implement user controls for fast forward, slow motion, and so forth. The normal playback rate is multiplied by this value to obtain the current rate, so a value of 1.0 indicates normal speed.

SetVolume(volume float64)

Sets the audio volume, from 0.0 (silent) to 1.0 (loudest).

Volume() float64

Returns the audio volume, from 0.0 (silent) to 1.0 (loudest).