Commit 835d3c89 by bachinger Committed by Rohit Singh

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
parent 0f85ce5d
...@@ -25,6 +25,8 @@ Release notes ...@@ -25,6 +25,8 @@ Release notes
* Remove deprecated symbols: * Remove deprecated symbols:
* Remove `DefaultAudioSink` constructors, use `DefaultAudioSink.Builder` * Remove `DefaultAudioSink` constructors, use `DefaultAudioSink.Builder`
instead. instead.
* Cast extension
* Bump Cast SDK version to 21.2.0.
### 1.0.0-beta03 (2022-11-22) ### 1.0.0-beta03 (2022-11-22)
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
apply from: "$gradle.ext.androidxMediaSettingsDir/common_library_config.gradle" apply from: "$gradle.ext.androidxMediaSettingsDir/common_library_config.gradle"
dependencies { 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 'androidx.annotation:annotation:' + androidxAnnotationVersion
implementation project(modulePrefix + 'lib-common') implementation project(modulePrefix + 'lib-common')
compileOnly 'org.checkerframework:checker-qual:' + checkerframeworkVersion compileOnly 'org.checkerframework:checker-qual:' + checkerframeworkVersion
......
...@@ -26,10 +26,6 @@ import com.google.android.gms.cast.MediaTrack; ...@@ -26,10 +26,6 @@ import com.google.android.gms.cast.MediaTrack;
/** Utility methods for Cast integration. */ /** Utility methods for Cast integration. */
/* package */ final class CastUtils { /* 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 * Returns the duration in microseconds advertised by a media info, or {@link C#TIME_UNSET} if
* unknown or not applicable. * unknown or not applicable.
...@@ -42,9 +38,7 @@ import com.google.android.gms.cast.MediaTrack; ...@@ -42,9 +38,7 @@ import com.google.android.gms.cast.MediaTrack;
return C.TIME_UNSET; return C.TIME_UNSET;
} }
long durationMs = mediaInfo.getStreamDuration(); long durationMs = mediaInfo.getStreamDuration();
return durationMs != MediaInfo.UNKNOWN_DURATION && durationMs != LIVE_STREAM_DURATION return durationMs != MediaInfo.UNKNOWN_DURATION ? Util.msToUs(durationMs) : C.TIME_UNSET;
? Util.msToUs(durationMs)
: C.TIME_UNSET;
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment