目前正在开展UpnP项目.我想将我的iPod touch变成媒体服务器(例如:https://itunes.apple.com/in/app/arkmc-lite-dlna-upnp-media/id640095560?mt = 8).所以我使用了以下SDK(链接).我已成功集成,它显示在媒体服务器列表中,但是当我点击服务器时,它无法浏览媒体文件.有谁可以让我知道我的问题是什么?谢谢你的时间
这是一些简短的代码
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
upnp = [[PLT_UPnPObject alloc] init];
// create server and add ourselves as the delegate
PLT_MediaServerObject* server = [[PLT_MediaServerObject alloc] init];
[server setDelegate:self];
[upnp addDevice:server];
}
- (IBAction)performUPnPStarStop:(id)sender {
if ([upnp isRunning]) {
[upnp stop];
[mainButton setTitle:@"Start" forState:UIControlStateNormal];
} else {
[upnp start];
[mainButton setTitle:@"Stop" forState:UIControlStateNormal];
}
}
#pragma mark PLT_MediaServerDelegateObject
- (NPT_Result)onBrowseMetadata:(PLT_MediaServerBrowseCapsule*)info
{
return NPT_FAILURE;
}
- (NPT_Result)onBrowseDirectChildren:(PLT_MediaServerBrowseCapsule*)info
{
return NPT_FAILURE;
}
- (NPT_Result)onSearchContainer:(PLT_MediaServerSearchCapsule*)info
{
return NPT_FAILURE;
}
- (NPT_Result)onFileRequest:(PLT_MediaServerFileRequestCapsule*)info
{
return NPT_FAILURE;
}
Run Code Online (Sandbox Code Playgroud)
此外,我在日志中收到一条消息是'Info.plist'中找不到NEPTUNE_LOG_CONFIG

您绝对应该onBrowseDirectChildren:以某种有用的方式实现您的委托方法(等)。例如,对于onBrowseDirectChildren,您应该识别需要在响应中返回的所有项目,并使用它们构建响应(url 列表)。现在,由于涉及许多变量,这远远超出了答案所能完成的范围。
对于您来说,一个好的起点是将以下日志跟踪添加到,例如onBrowseDirectChildren:
NSLog(@"UPnP: Received Browse DirectChildren request for object %@, with sort criteria %s - count %d", info.objectId, info.sort, info.count);
Run Code Online (Sandbox Code Playgroud)
也许,您能做的最好的事情就是看看 XBMC 如何在 Platinum 之上实现自己的媒体服务器。
| 归档时间: |
|
| 查看次数: |
676 次 |
| 最近记录: |