Skip to content

Commit

Permalink
Merge pull request #29 from AAkira/dev/0.14.0
Browse files Browse the repository at this point in the history
ExoPlayer2.9.0
  • Loading branch information
AAkira authored Oct 19, 2018
2 parents 3b782c6 + 19a6d57 commit b795766
Show file tree
Hide file tree
Showing 11 changed files with 63 additions and 675 deletions.
12 changes: 11 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ android {

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
Expand All @@ -35,7 +39,13 @@ dependencies {
implementation project(':playermanager')
implementation project(':ima')

implementation "com.android.support:appcompat-v7:$APP_COMPAT_VERSION"
// overwrite support libraries
implementation "com.android.support:support-fragment:$APP_COMPAT_VERSION"
implementation "com.android.support:customtabs:$APP_COMPAT_VERSION"
implementation "com.android.support:recyclerview-v7:$APP_COMPAT_VERSION"
implementation "com.android.support:support-v4:$APP_COMPAT_VERSION"
implementation "com.android.support:support-compat:$APP_COMPAT_VERSION"
implementation "com.android.support:support-annotations:$APP_COMPAT_VERSION"

// exo palyer
implementation "com.google.android.exoplayer:exoplayer:$EXO_PLAYER_VERSION"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ package com.github.aakira.playermanager.sample.datasource

import android.content.Context
import com.google.android.exoplayer2.upstream.DataSource
import com.google.android.exoplayer2.upstream.TransferListener

class CustomDataSourceFactory(val context: Context, val listener: TransferListener<in DataSource>,
val dataSourceFactory: DataSource.Factory) : DataSource.Factory {
class CustomDataSourceFactory(
private val context: Context,
private val dataSourceFactory: DataSource.Factory
) : DataSource.Factory {

override fun createDataSource(): DataSource {
return PlayerDataSource(context, listener, dataSourceFactory.createDataSource())
return PlayerDataSource(context, dataSourceFactory.createDataSource())
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,24 @@ package com.github.aakira.playermanager.sample.datasource

import android.content.Context
import android.net.Uri
import com.google.android.exoplayer2.upstream.AssetDataSource
import com.google.android.exoplayer2.upstream.ContentDataSource
import com.google.android.exoplayer2.upstream.DataSource
import com.google.android.exoplayer2.upstream.DataSpec
import com.google.android.exoplayer2.upstream.FileDataSource
import com.google.android.exoplayer2.upstream.TransferListener
import com.google.android.exoplayer2.upstream.*
import com.google.android.exoplayer2.util.Assertions
import com.google.android.exoplayer2.util.Util
import java.io.IOException

class PlayerDataSource(context: Context, listener: TransferListener<in DataSource>?,
private var baseDataSource: DataSource) : DataSource {
class PlayerDataSource(context: Context, private var baseDataSource: DataSource) : DataSource {

private var dataSource: DataSource? = null
private val fileDataSource: DataSource by lazy { FileDataSource(listener) }
private val assetDataSource: DataSource by lazy { AssetDataSource(context, listener) }
private val contentDataSource: DataSource by lazy { ContentDataSource(context, listener) }
private val fileDataSource: DataSource = FileDataSource()
private val assetDataSource: DataSource = AssetDataSource(context)
private val contentDataSource: DataSource = ContentDataSource(context)

override fun addTransferListener(transferListener: TransferListener?) {
baseDataSource.addTransferListener(transferListener)
fileDataSource.addTransferListener(transferListener)
assetDataSource.addTransferListener(transferListener)
contentDataSource.addTransferListener(transferListener)
}

@Throws(IOException::class)
override fun open(dataSpec: DataSpec): Long {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package com.github.aakira.playermanager.sample.datasource
import android.net.Uri
import com.google.android.exoplayer2.upstream.DataSource
import com.google.android.exoplayer2.upstream.DataSpec
import com.google.android.exoplayer2.upstream.TransferListener
import java.io.IOException
import javax.crypto.spec.SecretKeySpec

Expand All @@ -12,6 +13,9 @@ import javax.crypto.spec.SecretKeySpec
*/
class VideoKeyUriSource(private val spec: SecretKeySpec) : DataSource {

override fun addTransferListener(transferListener: TransferListener?) {
}

private var dataSpec: DataSpec? = null

override fun getUri(): Uri {
Expand Down
18 changes: 9 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,25 @@
buildscript {

// This library version
ext.LIBRARY_VERSION_CODE = 13
ext.LIBRARY_VERSION_NAME = "0.13.0"
ext.LIBRARY_VERSION_CODE = 14
ext.LIBRARY_VERSION_NAME = "0.14.0"

// App information
ext.COMPILE_SDK_VERSION = 27
ext.BUILD_TOOLS_VERSION = "27.0.3"
ext.COMPILE_SDK_VERSION = 28
ext.BUILD_TOOLS_VERSION = "28.0.3"
ext.MIN_SDK_VERSION = 16
ext.TARGET_SDK_VERSION = 25
ext.TARGET_SDK_VERSION = 28

// Using libraries

// Base libraries
ext.KOTLIN_VERSION = "1.2.30"
ext.EXO_PLAYER_VERSION = "2.8.1"
ext.KOTLIN_VERSION = "1.2.71"
ext.EXO_PLAYER_VERSION = "2.9.0"
ext.IMA_VERSION = "3.7.2"

// Others
ext.APP_COMPAT_VERSION = "27.0.2"
ext.PLAY_SERVICE_VERSION = "11.2.0"
ext.APP_COMPAT_VERSION = "27.1.1"
ext.PLAY_SERVICE_VERSION = "16.0.0"
ext.KOTTER_KNIFE_VERSION = "0.1.0-SNAPSHOT"
ext.TIMBER_VERSION = "4.3.1@aar"

Expand Down
6 changes: 6 additions & 0 deletions ima/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ afterEvaluate {
dependencies {
implementation project(':playermanager')

// overwrite support libraries
implementation "com.android.support:support-v4:$APP_COMPAT_VERSION"
implementation "com.android.support:support-compat:$APP_COMPAT_VERSION"
implementation "com.android.support:support-annotations:$APP_COMPAT_VERSION"
implementation "com.android.support:customtabs:$APP_COMPAT_VERSION"

// kotlin
implementation "org.jetbrains.kotlin:kotlin-stdlib:$KOTLIN_VERSION"

Expand Down
Loading

0 comments on commit b795766

Please sign in to comment.