mediarouter.java介绍,MediaRouterProvider在网络中不可见

I created a SampleMediaRouteProvider as given in https://github.com/googlesamples/android-MediaRouter. In this sample there is also a MediaRouter that discovers all MediaRouteProviders in the network.

This SampleMediaRouteProvider is visible in the same device to other apps but its not visible to apps on other device in the same network.

Can you please help me to get MediaRouteProvider visible in wifi network.

Iam looking to create a MediaRenderer on a Android device that I could use to cast audio from other Android devices.

解决方案

MediaRouteProvider doesn't really do what you're asking.

The MediaRouteProvider, which you've written, has the role of allowing apps on your phone - device A - to find other devices on the network (device B or C). Device B and C can play the media you have on device A. Device A might stream/mirror directly (say to device B) or 'cast' (say to device C).

When mirroring, you send the audio content out of device A to device B. When casting, you only send a URL to device C, for example, the link to a video on youtube.com. And device C goes directly to the source to get the content.

I think you will need to:

Put your MediaRouteProvider on every device.

Implement a discovery mechanism

for example, based on using SSDP, mDNS, etc.

have your mediarouter implmenent discovery

Implement a webserver on the device(s) with content

or use something like nanohttpd

Now Write your MediaRenderer

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值