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

Ensure DASH media sources report bitrate changes #167

Merged
merged 3 commits into from
Jul 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if this is a smell that we're applying the eventListeners at the wrong level?

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'
}