问题描述
我想知道是否有人可以帮助我开发我在 android 上工作的应用程序。我已经在我的应用程序中集成了 UPNP。我在电视上播放电影。它工作正常。寻求是问题。当我使用 GetCurrentTransportActions 检查我最新的 TV SONY 控制器时间查找操作时。我从电视上收到:<Actions>Play,Stop,Pause</Actions>.
如果我从 ControlActivity 应用代码:
private synchronized void seek(final String targetPosition) {
new Thread() {
@Override
public void run() {
boolean isSuccess = mController.seek(mDevice,targetPosition);
if (isSuccess) {
LogUtil.d(TAG,"seek success");
sb_progress.setProgress(TimeUtil.getIntLength(targetPosition));
} else {
LogUtil.d(TAG,"seek failed..");
}
LogUtil.d(TAG,"seek TARGET POSITION:" + targetPosition);
runOnUiThread(new Runnable() {
public void run() {
if (mPlaying) {
startAutoIncreasing();
} else {
stopAutoIncreasing();
}
}
});
}
}.start();
}
这是 mController 类方法:
@Override
public boolean seek(Device device,String targetPosition) {
if (!targetPosition.contains(".")){
targetPosition += ".000";
}
LogUtil.d("ControlActivity:","target:" + targetPosition) ;
Service localService = device.getService(AVTransport1);
if (localService == null)
return false;
Action localAction = localService.getAction("Seek");
if (localAction == null) {
return false;
}
localAction.setArgumentValue("InstanceID","0");
localAction.setArgumentValue("Unit","ABS_TIME");
localAction.setArgumentValue("Target",targetPosition);//targetPosition
boolean postControlAction = localAction.postControlAction();
if (!postControlAction) {
LogUtil.d("ControlActivity::","postControl:") ;
localAction.setArgumentValue("Unit","REL_TIME");
localAction.setArgumentValue("Target",targetPosition);
return localAction.postControlAction();
} else {
return postControlAction;
}
}
结果是:
<detail><UPnPError xmlns="urn:schemas-upnp-org:control-1-0"><errorCode>710</errorCode><errorDescription>Action Seek failed
</errorDescription></UPnPError></detail>
你知道如何从 targetPosition 开始播放视频吗?因为我找到了一些应用程序,例如使用 DLNA 别名 Upnp 搜索某个时间位置没有问题的 Twonky 播放器。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)