0

I'm working on an iOS app with Google Cast support. One of the key features is playing radio live streams and with the native player (I'm using AVPlayer) I'm able to get timed metadata from the stream, so I can update the currently playing content while the live stream is being played. This is a very common feature you can find in almost every media app. To accomplish this, I just observe using KVO the timedMetadata property of the current item of the AVPlayer instance, and then filter the info of the keys that interest me.

When I load the same stream in the default receiver app of the Google Cast, I only get updates of the status, volume... but the metadata info is just the one I created the item with before loading it, and I can't find how to get this timed metadata.

Is there a way to implement this?

Daniel
  • 683
  • 1
  • 9
  • 20

1 Answers1

1

If you need more metadata beyond what is provided by the default receiver, then you need to implement your own custom receiver. You can start with our reference receiver: https://github.com/googlecast/CastReferencePlayer Additional information can be passed to the senders as part of the media update messages or you can use your own custom namespace.

Leon Nicholls
  • 4,623
  • 2
  • 16
  • 17
  • Thanks! That means that it's doable using a custom receiver, right? Does that implementation support it already? I've checked it and I couldn't find it. – Daniel Jul 26 '17 at 17:09
  • You will need to add custom logic to send the additional data to the senders. – Leon Nicholls Jul 26 '17 at 22:44
  • Great, I can try that. I have a couple of more questions. a) Should I add another listener to the media element to get timed metadata updates or does your media player library already provide a callback for that? b) I've used a listener in the sender iOS app where I get status updates, I guess I should use the custom data property for this additional data. How can I send this custom data from the receiver? – Daniel Jul 27 '17 at 10:06
  • For both it depends on your need and timing. There are callbacks on both the receiver and sender that you could hook into. If you add your metadata to the media status updates as a custom payload then you can use the media status updates otherwise use your own custom channel. – Leon Nicholls Jul 27 '17 at 15:49