Skip to content

Latest commit

 

History

History
69 lines (49 loc) · 1.95 KB

README.md

File metadata and controls

69 lines (49 loc) · 1.95 KB

Maven Central

RxExoPlayer

RxJava for ExoPlayer using Kotlin.

Download

implementation "com.github.satoshun.reactivex.exoplayer2:rxexoplayer:{latest-version}"

Introduction

This is a RxJava bindings for ExoPlayer.

This library supports below types.

Player.EventListener sample

Player can be convert to Rx Observable stream.

val player: ExoPlayer = ...
player.events()
    .subscribe {
      Log.d("Player.EventListener", it.toString())
    }

HLS sample

MediaSource can be convert to Rx Observable Stream.

// create a MediaSource.
val source = HlsMediaSource
    .Factory(mediaDataSourceFactory)
    .createMediaSource(Uri.parse(HLS_SAMPLE))
// convert to Rx Observable.
source.events()
    .subscribe {
      Log.d("MediaSourceEvent", it.toString())
    }
// set MediaSource into Player.
player.prepare(source)

License

Copyright (C) 2018 Sato Shun

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.