07-26-2022 07:53 AM
I've followed the instruction from https://developers.google.com/cast/docs/android_sender/integrate/about on how to cast media metadata to chromecast, the initial loading is fine, it will show the title, image and play the stream, but my problem is that I am streaming a live audio stream and need to update the metadata from time to time without having to buffer the audio again. This is a sample of my code: override fun loadMediaLoadRequestData(request: PlatformBridgeApis.MediaLoadRequestData?) { if (request == null) return val remoteMediaClient: RemoteMediaClient = remoteMediaClient ?: return val mediaLoadRequest = getMediaLoadRequestData(request) remoteMediaClient.load(mediaLoadRequest) } fun getMediaLoadRequestData(request: PlatformBridgeApis.MediaLoadRequestData): MediaLoadRequestData { val mediaInfo = getMediaInfo(request.mediaInfo) return MediaLoadRequestData.Builder() .setMediaInfo(mediaInfo) .setAutoplay(request.shouldAutoplay) .setCurrentTime(request.currentTime) .build() } fun getMediaInfo(mediaInfo: PlatformBridgeApis.MediaInfo?): MediaInfo? { if (mediaInfo == null) return null val streamType = getStreamType(mediaInfo.streamType) val metadata = getMediaMetadata(mediaInfo.mediaMetadata) val mediaTracks = mediaInfo.mediaTracks.map { getMediaTrack(it) } val customData = JSONObject(mediaInfo.customDataAsJson ?: "{}") return MediaInfo.Builder(mediaInfo.contentId) .setStreamType(streamType) .setContentType(mediaInfo.contentType) .setMetadata(metadata) .setMediaTracks(mediaTracks) .setStreamDuration(mediaInfo.streamDuration) .setCustomData(customData) .build() } Does anyone have any suggestion on how to modify loadMediaLoadRequestData in order to trigger the Chromecast receiver to update only the MediaMetadata and not have the stream buffer again
08-01-2022 10:55 PM
Hi braud94,
Thanks for reaching out. For developer concerns, I'd suggest you join the Google Developer Groups or Community for further help.
Thanks,
Jennifer
08-05-2022 11:22 AM
Hey there braud94,
Did you have any more questions or need any additional help?
Thank you,
Jeran
08-06-2022 04:09 PM
Hello braud94,
We haven't heard from you in a while so we’ll be locking this thread if there’s no update within 24 hours. If you still have other questions and concerns, please feel free to start a new thread and we'll be happy to help.
Thanks for the help, Jeran.
Thanks,
Jennifer