Closed GoogleCodeExporter closed 9 years ago
You do not need to set the duration; receiver should be able to get the
duration (from media element, etc) if needed.
Original comment by anad...@google.com
on 2 Jan 2015 at 2:10
See CastCompanionLibrary for an example use case:
1. A live stream (with duration = UNKOWN_DURATION) is playing on the receiver
2. The sender Android app receives a MediaInfo instance via a RemoteMediaPlayer
[1]. MediaInfo#getStreamDuration returns UNKOWN_DURATION.
3. This MediaInfo is serialized [2] and messaged to other Activities,
Fragments, etc. [3]
4. The MediaInfo gets deserialized [4] - for this [5] the MediaInfo.Builder
prohibits UNKNOWN_DURATION as a valid value for the stream's duration.
I am aware that one (and the CastCompanionLibrary) could work around this
issue, by only setting the duration field if StreamType != LIVE. Nevertheless I
still think UNKNOWN_DURATION should be allowed because it is a valid duration
value.
[1]
https://github.com/googlecast/CastCompanionLibrary-android/blob/master/src/com/g
oogle/sample/castcompanionlibrary/cast/VideoCastManager.java#L598
[2]
https://github.com/googlecast/CastCompanionLibrary-android/blob/master/src/com/g
oogle/sample/castcompanionlibrary/utils/Utils.java#L346
[3]
https://github.com/googlecast/CastCompanionLibrary-android/blob/master/src/com/g
oogle/sample/castcompanionlibrary/cast/VideoCastManager.java#L322
[4]
https://github.com/googlecast/CastCompanionLibrary-android/blob/master/src/com/g
oogle/sample/castcompanionlibrary/cast/player/VideoCastControllerFragment.java#L
146
[5]
https://github.com/googlecast/CastCompanionLibrary-android/blob/master/src/com/g
oogle/sample/castcompanionlibrary/utils/Utils.java#L458
Original comment by hugotheg...@gmail.com
on 2 Jan 2015 at 2:43
If you don't know the duration, don't set it.
Original comment by anad...@google.com
on 2 Jan 2015 at 3:33
Original issue reported on code.google.com by
hugotheg...@gmail.com
on 1 Jan 2015 at 7:23