An open API service indexing awesome lists of open source software.

https://github.com/m1ga/ti.exoplayer

Ti.Exoplayer - Audio/Video player for Android
https://github.com/m1ga/ti.exoplayer

android exoplayer titanium-mobile titanium-module

Last synced: about 1 month ago
JSON representation

Ti.Exoplayer - Audio/Video player for Android

Awesome Lists containing this project

README

        

# ExoPlayer module for Titanium SDK

Using Androids Media3 [ExoPlayer](https://developer.android.com/guide/topics/media/exoplayer) to play audio and video streams.
> ExoPlayer supports features not currently supported by Android’s MediaPlayer API, including DASH and SmoothStreaming adaptive playbacks

Based on Media3 ExoPlayer 1.1.1. [Suppored media formats](https://developer.android.com/guide/topics/media/media-formats)
Latest module version needs Titanium SDK 12.6.x+

## Code

```js
import exoPlayer from 'ti.exoplayer';
const exoView = exoPlayer.createExoPlayer();
```

## Methods
* play(): plays the audio/video file
* pause(): pauses the stream
* stop(): stops the stream
* release(): releases the player. Run this when you don't need it anymore
* seekTo(ms): seek to a position in the file

## Properties
* audioOnly (boolean, creation only): player won't create a "video surface" and safes resources.
* url (String): the URL of the audio/video file
* playing (boolean): current play status
* currentPosition (int): current position
* duration (int): duration (-1 if unavailable)
* minBufferDuration (int): min buffer duration in ms (default: 3000)
* maxBufferDuration (int): max buffer duration in ms (default: 8000)
* minResumeBuffer (int): min playback resume buffer duration in ms (default: 1500)
* minStartBuffer (int): min playback start buffer duration in ms (default: 500)
* targetBufferBytes (int): target buffer size in bytes. Only used if >-1 and other the other buffer durations will be ignored (default: -1)
* crossProtocolRedirects (boolean): Allow cross platform redirects (default: false)

## Events
* playerState: state (on of the constants)
* metaData: title, album, albumTitle, albumArtist
* seek: position, oldPosition

## Constants

* STATE_IDLE
* STATE_BUFFERING
* STATE_READY
* STATE_ENDED
* STATE_PLAYING

## Example

Check the `example/app.js` for code.

## Author

- Michael Gangolf ([@MichaelGangolf](https://twitter.com/MichaelGangolf) / [Web](http://migaweb.de))

Buy Me A Coke donate button