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
- Host: GitHub
- URL: https://github.com/m1ga/ti.exoplayer
- Owner: m1ga
- License: other
- Created: 2022-01-27T14:32:01.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-01-27T10:45:37.000Z (over 1 year ago)
- Last Synced: 2025-03-29T01:13:02.392Z (about 2 months ago)
- Topics: android, exoplayer, titanium-mobile, titanium-module
- Language: Java
- Homepage:
- Size: 2.06 MB
- Stars: 3
- Watchers: 1
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
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 playbacksBased 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))