更新Chromecast Media元数据 [英] Update Chromecast MediaMetadata

查看:80
本文介绍了更新Chromecast Media元数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Chromecast应用中播放实时HLS流,并且想在程序启动/结束时更新MediaMetadata。但是,我找不到执行此操作的方法。我可以使用新鲜的MediaInfo再次加载流,但不能仅更新现有的元数据。有什么办法做到这一点?

I'm playing a live HLS stream in a Chromecast app, and I'm wanting to update the MediaMetadata when programmes start/finish. However I can't find a method to do this. I can load the stream again with fresh MediaInfo, but I can't just update the existing metadata. Is there any way to do this?

目前我正在从Android应用程序投射内容。

At present I'm casting from an Android app.

是有没有一种方法可以将新的MediaMetadata发送到接收器,或者我可以通过自定义数据消息传递信息,并使用javascript更新发送器中的元数据?

Is there a way to send fresh MediaMetadata to the receiver, or can I pass a custom data message with the information, and update the metadata within the sender using javascript?

推荐答案

有关在诸如 onRemoteStatusChange ()...

see 'CCL' in general for the interfaces to manipulate things like metaData on events like onRemoteStatusChange()...

对此,IMO,如果您想更改下面的消息类型为 METADATA_CHANGE或无论mediaInfo发生什么变化,然后将消息发送给接收方,您都应该获得想要的广播... onMediaDataChanged()。

Looking at that, IMO if you want to alter the message type below to "METADATA_CHANGE" OR whatever it would be for a change in the mediaInfo, then just send the message to the receiver and you should get the broadcast you want... onMediaDataChanged().

从接收者到CastMgr的采样消息...

sample msg from receiver to CastMgr...

{"requestId":0,"status":{"applications":[{"appId":"33E59692","displayName":"test-receiver-app","namespaces":[{"name":"urn:x-cast:com.google.cast.player.message"},{"name":"urn:x-cast:com.google.cast.media"}],"sessionId":"0869F8A7-25CE-E55F-F571-346EBABB81FB","statusText":"Ready To Cast","transportId":"web-3"}],"isActiveInput":true,"volume":{"level":1.0,"muted":false}},"type":"RECEIVER_STATUS"}

onRemoteMediaPlayerStatusUpdated()

当视频结尾接收方从PLAY转到IDLE时,状态更改事件将在所有侦听器(即已注册为状态更改的侦听器的IVideoCastConsumer的所有实现)上调用。

When the receiver goes from PLAY to IDLE at the end of a video , the status change event is called on all 'listeners' ie all implementations of IVideoCastConsumer that have registered as listeners for 'status-changed'.

在BaseCastManager的Base CCL类中,您可以监视此特定状态更改,然后广播onRemoteMediaPlayerMetadataUpdated()事件,所有观察者都将对此进行适当的回调。 ..或监听事件,然后将正确类型的消息发送给接收者。

In the Base CCL class of BaseCastManager, you can watch for this specific status change and then broadcast your onRemoteMediaPlayerMetadataUpdated() event and all observers will get appropriate callback on that.... OR listen on event and just send the correct type of message to the receiver.

如果它并非完全旨在观察IMO的mediaMetaDataChanges,则进行查找可能会帮助您使用和@Override对现有的API进行调试,以获得所需的结果。

If its not exactly intended to observe mediaMetaDataChanges IMO , looking it over may help you tweek the existing API with and @Override in order to get your desire result.

这篇关于更新Chromecast Media元数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆