封装DLNA功能,基于Upnp实现简单的视频投射
使用SSDP发现设备
使用SOAP控制设备
封装常用操作(播放,暂停等)
实现了DMC功能
实现投射本地资源功能
引用的依赖库:GCDAsyncUdpSocket、GDataXML、GCDWebServer、Masonry
DLNAUpnpServer.h
DLNA服务类,用于扫描设备Device.h
设备DeviceChangeDelegate.h
设备变化代理ControlPoint.h
控制点类,用于执行动作ControlService.h
封装设备可用的控制服务Action
封装所有操作的动作,详细见Action文件夹Config.h
定义配置类FileServer.h
文件服务类,用于投射本地资源,不用此功能可无视
- 如果不需要投射本地资源的话,可以不用复制FileServer.h/.m 和 GCDWebServer文件夹,不用配置GCDWebServer和FileServer
- 项目target -> Build Settings -> Search Paths -> Search Header Paths 添加 "$(SDKROOT)/usr/include/libxml2"
- 项目target -> Build Phases -> Link Binary With Libraries -> 添加 "libxml2.2.tbd"
- 项目target -> Build Phases -> Compile Sources -> 选择GDataXMLNode.m 回车添加 "-fno-objc-arc"
- 项目target -> Build Phases -> Link Binary With Libraries -> 添加 "libz.1.2.5.tbd"
- 项目target -> Build Phases -> Link Binary With Libraries -> 添加 "Photos.framework"
- ps: 可根据自己需求修改本地资源的获取方式(不用PhotoKit)
[[DLNAUpnpServer shareServer] start];
[[FileServer shareServer] start];
- 根目录下
pod install
- 打开DLNAWrapper.xcworkspace
- ps: 例子写的有点随便,请不要在意
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.