Skip to content
This repository has been archived by the owner on Feb 11, 2022. It is now read-only.

Commit

Permalink
Merge pull request #167 from novoda/use-event-listener-with-dash
Browse files Browse the repository at this point in the history
Ensure DASH media sources report bitrate changes
  • Loading branch information
Ryan Feline authored Jul 6, 2018
2 parents e74f9c6 + 3395736 commit 43f1da8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ dependencies {
implementation 'com.google.android.exoplayer:exoplayer:2.8.1'

testImplementation 'junit:junit:4.12'
testImplementation 'org.mockito:mockito-core:2.16.0'
testImplementation 'org.mockito:mockito-core:2.19.0'
testImplementation 'org.easytesting:fest-assert-core:2.0M10'
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public MediaSource create(Options options,
case H264:
return createH264MediaSource(defaultDataSourceFactory, uri, mediaSourceEventListener);
case DASH:
return createDashMediaSource(defaultDataSourceFactory, uri);
return createDashMediaSource(defaultDataSourceFactory, uri, mediaSourceEventListener);
default:
throw new UnsupportedOperationException("Content type: " + options + " is not supported.");
}
Expand All @@ -64,9 +64,12 @@ private MediaSource createH264MediaSource(DefaultDataSourceFactory defaultDataSo
}

private MediaSource createDashMediaSource(DefaultDataSourceFactory defaultDataSourceFactory,
Uri uri) {
Uri uri,
MediaSourceEventListener mediaSourceEventListener) {
DefaultDashChunkSource.Factory chunkSourceFactory = new DefaultDashChunkSource.Factory(defaultDataSourceFactory);
DashMediaSource.Factory factory = new DashMediaSource.Factory(chunkSourceFactory, defaultDataSourceFactory);
return factory.createMediaSource(uri);
DashMediaSource mediaSource = factory.createMediaSource(uri);
mediaSource.addEventListener(handler, mediaSourceEventListener);
return mediaSource;
}
}
2 changes: 1 addition & 1 deletion demo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ dependencies {
implementation 'com.android.support:appcompat-v7:27.1.1'

testImplementation 'junit:junit:4.12'
testImplementation 'com.google.truth:truth:0.40'
testImplementation 'com.google.truth:truth:0.41'
}

0 comments on commit 43f1da8

Please sign in to comment.