Code Monkey home page Code Monkey logo

ti.exoplayer's Introduction

ExoPlayer module for Titanium SDK

Using Androids Media3 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.0. Suppored media formats

Code

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

Buy Me A Coke donate button

ti.exoplayer's People

Contributors

m1ga avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.