My Project
Instance Methods | Class Methods | List of all members
NECopyrightedMedia Class Reference

版权接口对象 More...

#import <NECopyrightedMedia.h>

Inheritance diagram for NECopyrightedMedia:

Instance Methods

(void) - initialize:token:userUuid:extras:callback:
 
(void) - preloadSong:channel:observe:
 
(void) - clearSongCache
 
(void) - cancelPreloadSong:channel:
 
(bool) - isSongPreloaded:channel:
 
(void) - searchSong:channel:pageNum:pageSize:callback:
 
(NSString *_Nullable) - getSongURI:channel:songResType:
 
(NSString *_Nullable) - getLyric:channel:
 
(NSString *_Nullable) - getPitch:channel:
 
(void) - preloadSongLyric:channel:callback:
 
(void) - getSongList:channel:pageNum:pageSize:callback:
 
(void) - getHotSongList:hotDimension:channel:pageNum:pageSize:callback:
 
(void) - setEventHandler:
 
(void) - renewToken:
 
(BOOL) - hasInitialized
 
(void) - setSongScene:
 

Class Methods

(instancetype) + getInstance
 

Detailed Description

版权接口对象

Method Documentation

◆ cancelPreloadSong:channel:

- (void) cancelPreloadSong: (NSString *)  songId
channel: (SongChannel channel 

取消预加载 Song 数据

Parameters
songId歌曲id
channel渠道

◆ clearSongCache

- (void) clearSongCache

清理本地所有缓存歌曲数据

◆ getHotSongList:hotDimension:channel:pageNum:pageSize:callback:

- (void) getHotSongList: (NECopyrightedHotType hotType
hotDimension: (NECopyrightedHotDimension hotDimension
channel: (NSNumber *_Nullable)  channel
pageNum: (NSNumber *_Nullable)  pageNum
pageSize: (NSNumber *_Nullable)  pageSize
callback: (void(^)(NSArray< NECopyrightedHotSong * > *songList, NSError *error))  callback 

榜单歌曲查询

Parameters
hotType热门类型
hotDimension场景类型
channel渠道 SongChannel: 可为空
pageNum页码
pageSize页面size 默认 20
callback回调

◆ getInstance

+ (instancetype) getInstance

单例模式

Returns
单例对象

◆ getLyric:channel:

- (NSString *_Nullable) getLyric: (NSString *_Nonnull)  songId
channel: (SongChannel channel 

歌词

Parameters
songId音乐 ID
channel渠道
Returns
歌词内容

◆ getPitch:channel:

- (NSString *_Nullable) getPitch: (NSString *_Nonnull)  songId
channel: (SongChannel channel 

打分

Parameters
songId音乐 ID
channel渠道
Returns
打分内容

◆ getSongList:channel:pageNum:pageSize:callback:

- (void) getSongList: (NSArray< NSString * > *_Nullable)  tags
channel: (NSNumber *_Nullable)  channel
pageNum: (NSNumber *_Nullable)  pageNum
pageSize: (NSNumber *_Nullable)  pageSize
callback: (void(^)(NSArray< NECopyrightedSong * > *songList, NSError *error))  callback 

歌曲列表

Parameters
tags设置nil 预留字段
channel渠道 SongChannel: 可为空
pageNum页码
pageSize页面size 默认 20
callback回调

◆ getSongURI:channel:songResType:

- (NSString *_Nullable) getSongURI: (NSString *_Nonnull)  songId
channel: (SongChannel channel
songResType: (SongResType songResType 

原唱&伴奏:传给 NERtc 播放的 URI

Parameters
songId音乐 ID
channel渠道
songResType1:原唱,2:伴奏
Returns
返回资源的本地路径

◆ hasInitialized

- (BOOL) hasInitialized

获取版权组件是否已经初始化

Returns
YES:已经初始化;NO 未初始化

◆ initialize:token:userUuid:extras:callback:

- (void) initialize: (NSString *_Nonnull)  appkey
token: (NSString *_Nonnull)  token
userUuid: (NSString *_Nullable)  userUuid
extras: (NSDictionary *_Nullable)  extras
callback: (void(^)(NSError *_Nullable error))  callback 

初始化 NECopyrightedMedia

Parameters
appkeyappkey
tokentoken
userUuiduserUuid
extras填入Nil
callback异步回调 NSError 为Nil 则成功

◆ isSongPreloaded:channel:

- (bool) isSongPreloaded: (NSString *)  songId
channel: (SongChannel channel 

检测是否已预加载 Song 数据

Parameters
songId歌曲id
channel渠道
Returns
是否已预加载

◆ preloadSong:channel:observe:

- (void) preloadSong: (NSString *)  songId
channel: (SongChannel channel
observe: (id< NESongPreloadProtocol > _Nullable)  observe 

预加载 Song 数据

Parameters
songId歌曲id
channel渠道
observe观察者

◆ preloadSongLyric:channel:callback:

- (void) preloadSongLyric: (NSString *)  songId
channel: (SongChannel channel
callback: (void(^)(NSString *_Nullable content, NSString *_Nullable lyricType, NSError *_Nullable error))  callback 

预加载歌词

Parameters
songId音乐ID
callback回调

◆ renewToken:

- (void) renewToken: (NSString *)  token

更新Token

Parameters
tokenToken

◆ searchSong:channel:pageNum:pageSize:callback:

- (void) searchSong: (NSString *_Nullable)  keyword
channel: (NSNumber *_Nullable)  channel
pageNum: (NSNumber *_Nullable)  pageNum
pageSize: (NSNumber *_Nullable)  pageSize
callback: (void(^)(NSArray< NECopyrightedSong * > *_Nullable songList, NSError *_Nullable error))  callback 

搜索歌曲

Parameters
keyword搜索关键词
channel渠道 SongChannel: 可为空
pageNum页码
pageSize每页数据大小
callback回调

◆ setEventHandler:

- (void) setEventHandler: (id< NECopyrightedEventHandler >)  observe

设置版权接口过期监听对象

Parameters
observe监听对象

◆ setSongScene:

- (void) setSongScene: (SongScene songScene

设置获取资源场景

Parameters
songScene场景枚举值,不同场景获取的资源不同

The documentation for this class was generated from the following file: