本文介绍了Android关闭ChromeCast屏幕镜像功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的ChromeCast屏幕镜像功能有问题。因为如果用户使用Screen Cast,我的内容受到保护(DRM视频),所以我需要检查并关闭或显示其他内容(例如受保护的内容消息图片)而不是视频。

I have a problem with ChromeCast Screen Mirroring function. Because my content is protected (DRM video) if the user use Screen Cast i need check and turn off or show something else (like protected content message picture) and not the video.

我的问题是:它可能检测屏幕镜像并禁用代码吗?

My question is: Its possible detect Screen Mirroring and disable in code?

推荐答案

您可以在应用中实现Chromecast支持并选择在镜像屏幕时要投射的布局(因此只需投射一个空的布局或信息等)。如果您在Android ApiDemos(或Google)中查看示例PresentationWithMediaRouterActivity,则可以看到一个很好的示例实现。

You can implement Chromecast-support in your app and choose which layout to cast when the screen is mirrored (so just cast an empty layout or information etc). If you check the example PresentationWithMediaRouterActivity in Android ApiDemos (or Google it and you will find the files needed), you can see a good example implementation that does just that.

这篇关于Android关闭ChromeCast屏幕镜像功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-14 12:09