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

I think you have mistakenly done wrong in coding of this extension that’s why I m getting error while exporting the app…
Can you check what’s the problem behind the error…and can you solve the problem of progress slider and forward and backward buttons disable problem only when using MKV format movie but when I use MP4 format movie it works fine…
If you can solve the problem so fix it or provide a solution…:grinning:

1 Like

When will you add title view…
I have requested you from many days but you haven’t answered that you are going to add or not

1 Like

There is a new block in the UI extension called OnVisibilityChanged You can use that to show or hide a custom title label.

You can use my Relative View extension to overlap that label onto the player.

3 Likes

I don’t know how can I use it can you tell me how can I do this…
@zainulhassan

Exoplayer Core 1.0.4

Events


on_render_first_frame

Event raised when player has rendered first media frame.

on_state_changed

Event raised when player state changes.

on_is_playing_changed

Event raised when current playing state changes.

on_loading_changed

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

transition_reason

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.

repeat_modes

Event raised when shuffle mode changes.

Event raised when video size is changed or first measured.

on_volume_changed

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_media

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

subtitle_json_sample


Available Selection Flags For Subtitles

selection_flags

remove_media_item

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

Seek to specific milliseconds.

format

Convert milliseconds to hh:mm:ss format.


Properties


set_repeat_modes

repeat_modes

Set repeat modes for player.

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.

This post was flagged by the community and is temporarily hidden.

As I mentioned earlier, its not a bug in the player. The issue is that player can’t process the codecs in that mkv file. You can convert it to supported codes using ffmpeg library.

And I have told you another problem is that I have imported your provided aia in both mit apo Inventor and kodular but when I tried to export apk it can’t export I have attached a screenshot before, the error cames in both builders…

2 Likes

The issue has been fixed. I will push an update till night.

But how can I convert videos into supported codecs…
Any apk?
How can I use ffmpeg library to convert videos…
Can u tell what codecs are supported by your ExoPlayer…

Can you provide a sample aia for adding title because I very confused now…
Provide a sample aia with title view…

1 Like

Please wait. I am writing docs for the extension.

What codecs are supported by your video player…

https://exoplayer.dev/supported-formats.html

I have a request if you can do it,
Cast feature
This help us to cast media from mobile phone to android tv with cast options available

1 Like

Exoplayer UI 1.0.4

Events


on_fullscreen_changed

Event raised when fullscreen button is clicked and its status changes. Here you can perform different functions to enter or exit fullscreen.


Example

on_visibility_changed

Event raised when controls visibility changes. Here you can update your UI. For example : You can show/hide a title label etch.


Functions


create_simple

Create player view in a layout.

create_styled

Create styled player view.

show_controls

Show controls.

hide_controls

Hide Controls.

show_system_ui

Show system UI. The function is in experimental phase and may not work properly.

hide_system_ui

Hide System UI. The function is in experimental phase and may not work properly.


Properties


fast_forward_button_visible

next_button_visible

previous_button_visible

rewind_button_visible

shuffle_button_visible

subtitle_button_visible

Show or hide player controls

use_artwork

Set whether to show an image when playing an audio file.

default_thumbnail

Set default thumbnail in case if there is no thumbnail in media metadata, the player will show this thumbnail. It works only for audio files.

repeat_mode

Set repeat toggle modes. This will show/hide repeat toggle button.

show_loading

Set when to show loading progress indicator.

resize_mode

Set video resize mode

auto_show_controller

Automatically show controller when media is interupted during playback.

controller_timeout

Milliseconds after which the controller should hide.

hide_on_touch

Hide controller on touch.

use_controller

Whether to use default controller or not.

animation_enabled

Enable/Disable controls animation.


Track Properties

Active thumb size.

thumb_size

Thumb size.

Disabled thumb size.

Buffered track color.

track_color

Track color.

Progress color.


Subtitle Properties

Subtitle background color.

Subtitle foreground color. ( Text Color )

Subtitle edge color.

Subtitle window color.

text_size_type

Text size type.
1- Use SizeTypeAbsolute if you want to set a specific font size irrespective of the player size.
2- Use SizeTypeFractional if you want to set font size relative the player size.

Absolute text size.

Fractional text size.

render_view_type

Subtitle render view type. Use ViewTypeWeb if your subtitles have html styles embedded. For general purpose, you can always use ViewTypeCanvas.

edge_type

Subtitle edge type.

Subtitle bottom padding.

Whether to ignore bottom padding or not.

Specify a custom font.

@zainulhassan

one bug didn’t solved yet is that the when I m watching a video the brightness decreased to lowest automatically after watching a video more than 10 minutes…solve this issue…:sob::sob:

This is a sample aia that shows how you can customize ui, add title etc :
exoplayer_with_title.aia (1.9 MB)
(App Inventor)

@zainulhassan

Your extension works good with app inventor but not with kodular, I have tried many times I have getting many issues in kodular but when using aap inventor it works fine but one bug didn’t solved is that the when I m watching a video the brightness decreased to lowest automatically after watching a video more than 10 minutes…solve this issue…