Class Info |
|---|
public class PlayerClient Cast Engine大屏设备侧实例。 |
Qualifier and Type |
Method Name and Description |
|---|---|
PlayerClient |
获取PlayerClient实例。 |
boolean |
init(Context context) 初始化投屏服务。 |
void |
deinit()() 注销投屏服务。 |
boolean |
registerCallback(IEventListener listener) 注册手机连接状态与大屏投屏业务的回调。 |
void |
unregisterCallback(IEventListener listener) 注销手机连接状态与大屏投屏业务的回调。 |
boolean |
setAuthMode(AuthInfo info) 设置当前设备鉴权模式。 |
boolean |
setDiscoverable(boolean enable, DeviceInfo info) 设置当前大屏端设备是否可被发现。 |
boolean |
setCapability(HiSightCapability capability) 设置大屏端设备支持的投屏能力。 |
boolean |
启动投屏。 |
boolean |
启动投屏。 |
boolean |
pause(ProjectionDevice device) @Deprecated 暂停投屏。(该方法已废弃,可用pause(TrackControl tc)代替) |
boolean |
暂停投屏。 |
boolean |
setHiSightSurface(Surface surface) 设置显示投屏画面的Surface。首次投屏或Surface发生变更时必须重新设置,并调用play()方法开始投屏。 |
void |
disconnectDevice(ProjectionDevice device) 断开连接。 |
boolean |
setConnectRequestChooseResult(ConnectRequestChoice choice) 未连接过设备连接到大屏端时,会通过Constant.EVENT_ID_PIN_CODE_SHOW事件通知应用层显示对应的提示框,请大屏端用户确认是否可以允许远端设备投屏,选择结果通过该方法设置。 |
boolean |
setDisplayInfo(DisplayInfo displayInfo) 当大屏端旋转或者图像尺寸发生变化时,重新设置显示相关信息。 |
Method |
|---|
public static PlayerClient getInstance() 获取PlayerClient实例。 |
Return
Type |
Description |
|---|---|
PlayerClient |
PlayerClient实例。 |
Method |
|---|
public boolean init(Context context) 初始化投屏服务。 |
Parameters
Name |
Description |
|---|---|
context |
PlayerClient依赖的上下文。 |
Return
Type |
Description |
|---|---|
boolean |
|
Method |
|---|
public boolean registerCallback (IEventListener listener) 注册手机连接状态与大屏投屏业务的回调。 |
Parameters
Name |
Description |
|---|---|
listener |
事件接收接口。 |
Return
Type |
Description |
|---|---|
boolean |
|
Method |
|---|
public void unregisterCallback (IEventListener listener) 注销手机连接状态与大屏投屏业务的回调。 |
Parameters
Name |
Description |
|---|---|
listener |
事件接收接口。 |
Parameters
Name |
Description |
|---|---|
info |
设备鉴权模式,可选值有: AuthInfo.AUTH_MODE_GENERIC:PIN码模式 AuthInfo.AUTH_MODE_PWD:密码模式 |
Return
Type |
Description |
|---|---|
boolean |
|
Method |
|---|
public boolean setDiscoverable(boolean enable, DeviceInfo info) 设置当前大屏端设备是否可被发现。 |
Parameters
Name |
Description |
|---|---|
enable |
|
info |
本地设备信息对象。 |
Return
Type |
Description |
|---|---|
boolean |
|
Method |
|---|
public boolean setCapability(HiSightCapability capability) 设置大屏端设备支持的投屏能力。 |
Parameters
Description |
Description |
|---|---|
capability |
端侧设备能力。 |
Return
Type |
Description |
|---|---|
boolean |
|
Method |
|---|
public boolean play(ProjectionDevice device) @Deprecated 启动投屏。(该方法已废弃,可用play(TrackControl tc)代替) |
Parameters
Name |
Description |
|---|---|
device |
要投屏的对端的设备。 |
Return
Type |
Description |
|---|---|
boolean |
|
Method |
|---|
public boolean play(TrackControl tc) 启动投屏。 |
Parameters
Name |
Description |
|---|---|
tc |
音视频轨控制信息。 |
Return
Type |
Description |
|---|---|
boolean |
|
Method |
|---|
public boolean pause(ProjectionDevice device) @Deprecated 暂停投屏。(该方法已废弃,可用pause(TrackControl tc)代替) |
Parameters
Name |
Description |
|---|---|
device |
要投屏的对端的设备。 |
Return
Type |
Description |
|---|---|
boolean |
|
Method |
|---|
public boolean pause(TrackControl tc) 暂停投屏。 |
Parameters
Name |
Description |
|---|---|
tc |
音视频轨控制信息。 |
Return
Type |
Description |
|---|---|
boolean |
|
Method |
|---|
public boolean setHiSightSurface(Surface surface) 设置显示投屏画面的Surface。首次投屏或Surface发生变更时必须重新设置,并调用play()方法开始投屏。 |
Parameters
Name |
Description |
|---|---|
surface |
用于显示投屏内容的Surface。 |
Return
Type |
Description |
|---|---|
boolean |
|
Method |
|---|
public void disconnectDevice (ProjectionDevice device) 断开连接。 |
Parameters
Name |
Description |
|---|---|
device |
要断开的对端设备。 |
Method |
|---|
public boolean setConnectRequestChooseResult(ConnectRequestChoice choice) 未连接过设备连接到大屏端时,会通过Constant.EVENT_ID_PIN_CODE_SHOW事件通知应用层显示对应的提示框,请大屏端用户确认是否可以允许远端设备投屏,选择结果通过该方法设置。 |
Parameters
Name |
Description |
|---|---|
choice |
连接请求确认结果类,可选值有:
|
Return
Type |
Description |
|---|---|
boolean |
|
Method |
|---|
public boolean setDisplayInfo (DisplayInfo displayInfo) 当大屏端旋转或者图像尺寸发生变化时,重新设置图像尺寸,旋转方向等信息。 |
Parameters
Name |
Description |
|---|---|
displayInfo |
可以设置图像尺寸,旋转方向,是否为悬浮窗等信息,具体请参考DisplayInfo。 |
Return
Type |
Description |
|---|---|
boolean |
|