Bump cast sdk version and remove workaround for live duration

The fix for b/171657375 (internal) has been shipped with 21.1.0 already (see https://developers.google.com/cast/docs/release-notes#august-8,-2022).

PiperOrigin-RevId: 491583727
This commit is contained in:
bachinger 2022-11-29 10:59:22 +00:00 committed by Rohit Singh
parent 51d1c0b892
commit 04f031d168
2 changed files with 2 additions and 8 deletions

View File

@ -14,7 +14,7 @@
apply from: "$gradle.ext.exoplayerSettingsDir/common_library_config.gradle"
dependencies {
api 'com.google.android.gms:play-services-cast-framework:21.0.1'
api 'com.google.android.gms:play-services-cast-framework:21.2.0'
implementation 'androidx.annotation:annotation:' + androidxAnnotationVersion
implementation project(modulePrefix + 'library-common')
compileOnly 'org.checkerframework:checker-qual:' + checkerframeworkVersion

View File

@ -26,10 +26,6 @@ import com.google.android.gms.cast.MediaTrack;
/** Utility methods for Cast integration. */
/* package */ final class CastUtils {
/** The duration returned by {@link MediaInfo#getStreamDuration()} for live streams. */
// TODO: Remove once [Internal ref: b/171657375] is fixed.
private static final long LIVE_STREAM_DURATION = -1000;
/**
* Returns the duration in microseconds advertised by a media info, or {@link C#TIME_UNSET} if
* unknown or not applicable.
@ -42,9 +38,7 @@ import com.google.android.gms.cast.MediaTrack;
return C.TIME_UNSET;
}
long durationMs = mediaInfo.getStreamDuration();
return durationMs != MediaInfo.UNKNOWN_DURATION && durationMs != LIVE_STREAM_DURATION
? Util.msToUs(durationMs)
: C.TIME_UNSET;
return durationMs != MediaInfo.UNKNOWN_DURATION ? Util.msToUs(durationMs) : C.TIME_UNSET;
}
/**