iOS 乐播投屏SDK集成

作者: 冷煖自知 | 来源:发表于2018-03-06 17:44 被阅读1495次

下载SDK

乐播投屏SDK下载

在Build Setting中Other Linker Flags添加-ObjC

Bulid Phases添加系统类库


引入头文件

#import <HPCastLink/HPCastLink.h>

#import <HPCastLink/HPDevicesService.h>

添加代理

<HPCastSearchDelegate, HPCastLinkDelegate>

在viewDidLoad中

[[HPCastLink sharedCastLink]appkeyVerify:@"<#AppKey#>"];

[HPCastLink sharedCastLink].delegate = self;

[HPCastLink sharedCastLink].enableDLNA = YES;

[[HPCastLink sharedCastLink]setBackgroundPlay:NO];

[[HPCastLink sharedCastLink]castServiceDiscoveryDelegate:self];

[[HPCastLink sharedCastLink]castServiceDiscoveryBlock:^(NSArray *response) {      

                   [self.dataArray removeAllObjects];

[self.dataArray addObjectsFromArray:response];

[self.tableView reloadData];

[[HPCastLink sharedCastLink]castServiceStopDiscovery];

}];

[[HPCastLink sharedCastLink]castStartPlay:HPCastMediaTypeVideo url:@"http://demon-1252098972.costj.myqcloud.com/562151.MOV" startPosition:0 superViewController:self completeBlock:^(HPCastMirrorResults response) {

NSLog(@"%lu",(unsigned long)response); NSLog(@"==============%d",[HPCastLink sharedCastLink].isMirrorTv);

[[HPCastLink sharedCastLink]castDeviceVolume:0];

}];

[听雨阁](http://www.ledemon.top)

相关文章

网友评论

    本文标题:iOS 乐播投屏SDK集成

    本文链接:https://www.haomeiwen.com/subject/vigclttx.html