1*30877f79SAndroid Build Coastguard Worker# RTMP DataSource module
2*30877f79SAndroid Build Coastguard Worker
3*30877f79SAndroid Build Coastguard WorkerThis module provides a [DataSource][] implementation for requesting [RTMP][]
4*30877f79SAndroid Build Coastguard Workerstreams using [LibRtmp Client for Android][].
5*30877f79SAndroid Build Coastguard Worker
6*30877f79SAndroid Build Coastguard Worker[DataSource]: https://exoplayer.dev/doc/reference/com/google/android/exoplayer2/upstream/DataSource.html
7*30877f79SAndroid Build Coastguard Worker[RTMP]: https://en.wikipedia.org/wiki/Real-Time_Messaging_Protocol
8*30877f79SAndroid Build Coastguard Worker[LibRtmp Client for Android]: https://github.com/ant-media/LibRtmp-Client-for-Android
9*30877f79SAndroid Build Coastguard Worker
10*30877f79SAndroid Build Coastguard Worker## License note
11*30877f79SAndroid Build Coastguard Worker
12*30877f79SAndroid Build Coastguard WorkerPlease note that whilst the code in this repository is licensed under
13*30877f79SAndroid Build Coastguard Worker[Apache 2.0][], using this extension requires depending on LibRtmp Client for
14*30877f79SAndroid Build Coastguard WorkerAndroid, which is licensed separately.
15*30877f79SAndroid Build Coastguard Worker
16*30877f79SAndroid Build Coastguard Worker[Apache 2.0]: https://github.com/google/ExoPlayer/blob/release-v2/LICENSE
17*30877f79SAndroid Build Coastguard Worker
18*30877f79SAndroid Build Coastguard Worker## Getting the module
19*30877f79SAndroid Build Coastguard Worker
20*30877f79SAndroid Build Coastguard WorkerThe easiest way to get the module is to add it as a gradle dependency:
21*30877f79SAndroid Build Coastguard Worker
22*30877f79SAndroid Build Coastguard Worker```gradle
23*30877f79SAndroid Build Coastguard Workerimplementation 'com.google.android.exoplayer:extension-rtmp:2.X.X'
24*30877f79SAndroid Build Coastguard Worker```
25*30877f79SAndroid Build Coastguard Worker
26*30877f79SAndroid Build Coastguard Workerwhere `2.X.X` is the version, which must match the version of the other media
27*30877f79SAndroid Build Coastguard Workermodules being used.
28*30877f79SAndroid Build Coastguard Worker
29*30877f79SAndroid Build Coastguard WorkerAlternatively, you can clone this GitHub project and depend on the module
30*30877f79SAndroid Build Coastguard Workerlocally. Instructions for doing this can be found in the [top level README][].
31*30877f79SAndroid Build Coastguard Worker
32*30877f79SAndroid Build Coastguard Worker[top level README]: https://github.com/google/ExoPlayer/blob/release-v2/README.md
33*30877f79SAndroid Build Coastguard Worker
34*30877f79SAndroid Build Coastguard Worker## Using the module
35*30877f79SAndroid Build Coastguard Worker
36*30877f79SAndroid Build Coastguard WorkerMedia components request data through `DataSource` instances. These instances
37*30877f79SAndroid Build Coastguard Workerare obtained from instances of `DataSource.Factory`, which are instantiated and
38*30877f79SAndroid Build Coastguard Workerinjected from application code.
39*30877f79SAndroid Build Coastguard Worker
40*30877f79SAndroid Build Coastguard Worker`DefaultDataSource` will automatically use the RTMP extension whenever it's
41*30877f79SAndroid Build Coastguard Workeravailable. Hence if your application is using `DefaultDataSource` or
42*30877f79SAndroid Build Coastguard Worker`DefaultDataSource.Factory`, adding support for RTMP streams is as simple as
43*30877f79SAndroid Build Coastguard Workeradding a dependency to the RTMP extension as described above. No changes to your
44*30877f79SAndroid Build Coastguard Workerapplication code are required. Alternatively, if you know that your application
45*30877f79SAndroid Build Coastguard Workerdoesn't need to handle any other protocols, you can update any
46*30877f79SAndroid Build Coastguard Worker`DataSource.Factory` instantiations in your application code to use
47*30877f79SAndroid Build Coastguard Worker`RtmpDataSource.Factory` directly.
48*30877f79SAndroid Build Coastguard Worker
49*30877f79SAndroid Build Coastguard Worker## Links
50*30877f79SAndroid Build Coastguard Worker
51*30877f79SAndroid Build Coastguard Worker* [Javadoc][]
52*30877f79SAndroid Build Coastguard Worker
53*30877f79SAndroid Build Coastguard Worker[Javadoc]: https://exoplayer.dev/doc/reference/index.html
54