我看到文档中介绍使用搜索:
wx.startLocalServiceDiscovery({ // 当前手机所连的局域网下有一个 _http._tcp. 类型的服务 serviceType: '_http._tcp.',
success: console.log,
fail: console.log
})我想问下 serviceType 目前只支持这一种吗?
不支持像DLNA 这样的 serviceType 吗
<serviceList><service><serviceType>urn:schemas-upnp-org:service:AVTransport:1</serviceType><serviceId>urn:upnp-org:serviceId:AVTransport</serviceId><SCPDURL>/AVTransport//scpd.xml</SCPDURL><controlURL>/AVTransport//control.xml</controlURL><eventSubURL>/AVTransport//event.xml</eventSubURL></service><service><serviceType>urn:schemas-upnp-org:service:ConnectionManager:1</serviceType><serviceId>urn:upnp-org:serviceId:ConnectionManager</serviceId><SCPDURL>/ConnectionManager//scpd.xml</SCPDURL><controlURL>/ConnectionManager//control.xml</controlURL><eventSubURL>/ConnectionManager//event.xml</eventSubURL></service><service><serviceType>urn:schemas-upnp-org:service:RenderingControl:1</serviceType><serviceId>urn:upnp-org:serviceId:RenderingControl</serviceId><SCPDURL>/RenderingControl//scpd.xml</SCPDURL><controlURL>/RenderingControl//control.xml</controlURL><eventSubURL>/RenderingControl//event.xml</eventSubURL></service></serviceList> |

可以的喔
嗯? 官方都说不能呀 是不是我表达不清楚啊
我搜索到了公司的打印机 = =
支持 mDNS 的都能搜到呢
DLNA 和 mDNS 是不同的标准,使用小程序的 mDNS API 无法搜索到 DLNA 服务。
而且,在 iOS 上 mDNS 是基于 Bonjour 实现的,其文档规定了 serviceType 的格式。
因此 urn:schemas-upnp-org:service:ConnectionManager:1 这样格式的 serviceType 是不可以的。
小程序中有没有 搜索同一局域网下的其他设备
比如我手机和电视都在 123WIFI 下使用 手机小程序能搜索到电视吗
其他设备必须提供 mDNS 服务,才能搜索到
好的 谢谢你 给我的回答
有人吗