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
(cherry picked from commit 835d3c89f2099ca66c5b5f7af686eace1ac17eb8)
This commit is contained in:
bachinger 2022-11-29 10:59:22 +00:00 committed by christosts
parent 3bf99706dc
commit 1d082ee9a7
3 changed files with 4 additions and 8 deletions

View File

@ -19,6 +19,8 @@
* Metadata:
* Parse multiple null-separated values from ID3 frames, as permitted by
ID3 v2.4.
* Cast extension
* Bump Cast SDK version to 21.2.0.
### 1.0.0-beta03 (2022-11-22)

View File

@ -14,7 +14,7 @@
apply from: "$gradle.ext.androidxMediaSettingsDir/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 + 'lib-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;
}
/**