OmxInstance

Extends EventEmitter

This class represents a single omxplayer instance.

Instance members

#constructor(manager, cmd, videos, args, nativeLoop)

Create a new instance.

constructor(manager, cmd, videos, args, nativeLoop)

Create a new instance.

Parameters

  • OmxManager manager :

    Reference to the parent manager.

  • string cmd :

    Command used to spawn the process.

  • Array .< string > videos :

    Videos to play.

  • object args :

    Arguments passed to the spawn command.

  • boolean nativeLoop :

    If native loop is supported and should be used when possible.

Returns

OmxInstance :

New omxplayer instance.

#decreaseSpeed

Decrease speed (sends key '1').

decreaseSpeed

Decrease speed (sends key '1').

#decreaseSubtitleDelay

Decrease subtitle delay (sends key 'f').

decreaseSubtitleDelay

Decrease subtitle delay (sends key 'f').

#decreaseVolume

Decrease volume (sends key '-').

decreaseVolume

Decrease volume (sends key '-').

#fastForward

Fast forward (sends key '>').

fastForward

Fast forward (sends key '>').

#getStatus

Returns the current status object.

getStatus

Returns the current status object.

Returns

StatusObject
#hideSubtitles

Hide subtitles (sends key 'x').

hideSubtitles

Hide subtitles (sends key 'x').

#increaseSpeed

Increase speed (sends key '2').

increaseSpeed

Increase speed (sends key '2').

#increaseSubtitleDelay

Increase subtitle delay (sends key 'd').

increaseSubtitleDelay

Increase subtitle delay (sends key 'd').

#increaseVolume

Increase volume (sends key '+').

increaseVolume

Increase volume (sends key '+').

#nextAudioStream

Gets next audio stream (sends key 'k').

nextAudioStream

Gets next audio stream (sends key 'k').

#nextChapter

Get next chapter (sends key 'o').

nextChapter

Get next chapter (sends key 'o').

#nextSubtitleStream

Gets next subtitle stream (sends key 'm').

nextSubtitleStream

Gets next subtitle stream (sends key 'm').

#pause

Pause the current video.

pause

Pause the current video.

#play

Play the current video in the serie.

play

Play the current video in the serie.

#previousAudioStream

Gets previous audio stream (sends key 'j').

previousAudioStream

Gets previous audio stream (sends key 'j').

#previousChapter

Get previous chapter (sends key 'i').

previousChapter

Get previous chapter (sends key 'i').

#previousSubtitleStream

Gets previous subtitle stream (sends key 'n').

previousSubtitleStream

Gets previous subtitle stream (sends key 'n').

#rewind

Rewind (sends key '<').

rewind

Rewind (sends key '<').

#seekBackward

Seek -30 s (sends '[D').

seekBackward

Seek -30 s (sends '[D').

#seekFastBackward

Seek -600 s (sends '[B').

seekFastBackward

Seek -600 s (sends '[B').

#seekFastForward

Seek +600 s (sends '[A').

seekFastForward

Seek +600 s (sends '[A').

#seekForward

Seek +30 s (sends '[C').

seekForward

Seek +30 s (sends '[C').

#showSubtitles

Show subtitles (sends key 'w').

showSubtitles

Show subtitles (sends key 'w').

#stop

Stop the current video.

stop

Stop the current video.

#toggleSubtitles

Toggles subtitles (sends key 's').

toggleSubtitles

Toggles subtitles (sends key 's').

OmxManager

Extends EventEmitter

This class is used to control multiple omxplayer instances.

Instance members

#constructor

New omxmanager instance.

constructor

New omxmanager instance.

Returns

OmxManager
#create(videos, [args])

Create a new instance and returns it.

create(videos, [args])

Create a new instance and returns it.

Parameters

  • ( Array .< string > | string ) videos :

    Videos to play.

  • object = args (default {}) :

    Arguments passed to the process.

Returns

( OmxInstance | null ) :

The instance object or null if empty.

#enableNativeLoop

Sets support to native loop flag.

enableNativeLoop

Sets support to native loop flag.

#setOmxCommand(cmd)

Set the default command to spawn.

setOmxCommand(cmd)

Set the default command to spawn.

Parameters

  • string cmd :

    The path to the executables to spawn for omxplayer.

#setVideosDirectory(path)

Set where to look for videos.

setVideosDirectory(path)

Set where to look for videos.

Parameters

#setVideosExtension(ext)

Set an extension for videos.

setVideosExtension(ext)

Set an extension for videos.

Parameters

Iterable

This class is used to iterate over an array.

Static members

.length

Length of the underlaying array.

length

Length of the underlaying array.

Instance members

#constructor(array, [loop])

Create an Iterable array.

constructor(array, [loop])

Create an Iterable array.

Parameters

  • Array .< any > array :

    The array to iterate

  • boolean = (default false) loop :

    If wrap around array when reaching end

Returns

Iterable
#get

Get the current item in array.

get

Get the current item in array.

Returns

Any
#getCurrentIndex

Returns current index of the array.

getCurrentIndex

Returns current index of the array.

Returns

number
#next

Move to next video.

next

Move to next video.

#setLoop

Set loop wrap around array when reaching end.

setLoop

Set loop wrap around array when reaching end.

#toArray

Returns the underlaying array.

toArray

Returns the underlaying array.

Returns

Array .< Any >

OmxInstance#end

Videos to play are ended (never called if you are in looping condition)

OmxInstance#pause

Successfully paused a video

OmxInstance#play(video)

Successfully started a video or resumed from pause

Parameters

  • video :

    {String} - Currently playing video

OmxInstance#stop

Successfully stopped a video (omxplayer process ends)