V1.0.5 Exoplayer for AppInventor | Play media with Google's Exoplayer

Exoplayer Core 1.0.4

Events


on_render_first_frame

Event raised when player has rendered first media frame.

Event raised when player state changes.

Event raised when current playing state changes.

Event raised when loading state changes.

Event raised when media item is changed. Basically when current video/audio is changed and player opens next media item from playlist.


Available Transition Reasons

Event raised when media metadata changes. You get a JSON response.

Sample Response

Event raised when repeat mode changes. You get a numerical repeatMode which you can compare with RepeatModes properties and perform function as per your requirement.

Event raised when shuffle mode changes.

Event raised when video size is changed or first measured.

Event raised when device volume changes.

on_error

Event raised when there is an error during media playback. Currently the block is not very efficient as it doesn’t provide proper detail for error. In the next version, I will try to error codes and respective error messages.


Functions


create_player

Create and initialize player. Must be called before using with Exoplayer UI

get_player

Returns the Exoplayer instance that you can use in Exoplayer UI - CreatePlayer


Example :

Add a new media item to playlist. You can use this block to add multiple media items which are then managed by the player in the form of playlist.

To add subtitles there are two ways :


Dictionary Block

You can pass a list of subtitles by using dictionary blocks.
Here only two parameters are required :
1- path
2- mime_type

And the rest of the parameters are optional and you can skip them.


JSON String


Available Selection Flags For Subtitles

Remove media item at specific index.

clear_media_items

Clear all media items.

play

Play media.

pause

Pause media.

stop

Stop media playback.

Seek to specific milliseconds.

Convert milliseconds to hh:mm:ss format.


Properties


set_repeat_modes

Set repeat modes for player.

play_when_ready

Set play when ready.

duration

Media duration.

current_position

Current media position.

buffered_location

Buffered location.

buffered_percentage

Buffered percentage.

is_loading

Check whether media is playing.

is_loading

Check whether media is loading.

playback_state

Current media playback state.