Chromecast自定义接收器样式 [英] Chromecast Custom Receiver styling

查看:111
本文介绍了Chromecast自定义接收器样式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为Chromecast应用创建了一个自定义接收器,用于接收媒体。但是,我想在加载我正在投射的媒体之前添加背景图片,水印,徽标等。根据此Google网站( https:// developers。该样式的媒体接收器目前可以使用该功能。 google.com/cast/docs/styled_receiver )我可以使用.background和.logo等在css字段中执行此操作,但我尝试将其添加到自定义接收器的css部分中,只是没有显示跳到我尝试从Sender应用流式传输的媒体。我究竟做错了什么?我不能上这些课吗?我已经导入了以下脚本:

 < script type = text / javascript src = // www.gstatic .com / cast / sdk / libs / receiver / 2.0.0 / cast_receiver.js< / script> 
< script type = text / javascript src = // www.gstatic.com/cast/sdk/libs/mediaplayer/0.7.0/media_player.js\"</script>


解决方案

这些CSS类特定于样式媒体的方式接收器工作。



对于您自己的自定义接收器,您需要定义要使用的CSS样式。



看看此示例应用程序如何创建符合Google Cast设计清单的接收器:




https://github.com/googlecast/Cast-Player-Sample


I created a custom receiver for my Chromecast app to receive media. However, I want to add a background picture, watermark, logo etc before the media I am casting is loaded. That functionality is currently available in the Styled Media Receiver and according to this Google site (https://developers.google.com/cast/docs/styled_receiver) I can do that in the css field with .background and .logo etc.But I try to add that into my css portion of the custom receiver, nothing shows up, just skips to the media I am trying to stream from Sender app. What am I doing wrong? Can I not put those classes? I am already importing the following scripts:

<script type="text/javascript" src="//www.gstatic.com/cast/sdk/libs/receiver/2.0.0/cast_receiver.js"></script>
<script type="text/javascript" src="//www.gstatic.com/cast/sdk/libs/mediaplayer/0.7.0/media_player.js"></script>

解决方案

Those CSS classes are specific to the way the Styled Media Receiver works.

For you own custom receiver, you need to define the CSS styles you want to use. The Styled Media Receiver classes won't just work for you.

Take a look at this sample app on how to create a receiver that complies with the Google Cast Design Checklist: https://github.com/googlecast/Cast-Player-Sample

这篇关于Chromecast自定义接收器样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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