我如何共享屏幕上的WiFi直接连接其他设备基地 [英] How can I share screen to another device base on WiFi direct connection

查看:430
本文介绍了我如何共享屏幕上的WiFi直接连接其他设备基地的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想开发一个AP通过使用WiFi直接连接共享(SOURCE)屏幕到另一个(接收器)设备。

我成功地通过Wifi直接的API,但获取presentationDisplay()返回null连接两台设备。看来源设备没有找到由接收设备输出的任何附加的显示服务。请问API级别4.2.2的支持呢?或者是任何的API,我可以注册显示的服务资源?

  //获取媒体路由器服务
mMediaRouter =(MediaRouter)getSystemService(Context.MEDIA_ROUTER_SERVICE);
MediaRouter.RouteInfo路线= mMediaRouter.getSelectedRoute(MediaRouter.ROUTE_TYPE_LIVE_VIDEO);
如果(路线!= NULL){
    显示presentationDisplay = route.get presentationDisplay();
    如果(presentationDisplay!= NULL){
        presentation presentation =新的演示presentation(这一点,presentationDisplay);
        Log.i(示踪物,presentation.show(););
        presentation.show();
    }
}
 

解决方案

这取决于你试图连接到设备上。 Android的默认情况下不作为Miracast /无线显示下沉。
为了能够实现机器人 - 机器人无线显示分享,请参阅 Miracast接收器支持Android的 - 方法文档

I want to develop an AP to share (SOURCE) screen to another (SINK) device by using WiFi direct connection.

I successfully connect two devices via Wifi direct API but getPresentationDisplay() returns null. It seems SOURCE device does not find any additional display service exported by SINK device. Does API level 4.2.2 support it? Or is any API that I can register the display service to SOURCE?

//Get Media router service
mMediaRouter = (MediaRouter) getSystemService(Context.MEDIA_ROUTER_SERVICE);
MediaRouter.RouteInfo route = mMediaRouter.getSelectedRoute(MediaRouter.ROUTE_TYPE_LIVE_VIDEO);
if (route != null) {
    Display presentationDisplay = route.getPresentationDisplay();
    if (presentationDisplay != null) {
        Presentation presentation = new DemoPresentation(this, presentationDisplay);
        Log.i("tracer", "presentation.show();");
        presentation.show();
    }
}

解决方案

It depends on the device that you are trying to connect to. Android by default does not act as a Miracast/ Wireless Display Sink.
To be able to achieve Android - Android wireless display sharing, refer to Miracast Sink support for android - HowTo

这篇关于我如何共享屏幕上的WiFi直接连接其他设备基地的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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