本文整理汇总了Java中org.fourthline.cling.support.avtransport.callback.Seek类的典型用法代码示例。如果您正苦于以下问题:Java Seek类的具体用法?Java Seek怎么用?Java Seek使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Seek类属于org.fourthline.cling.support.avtransport.callback包,在下文中一共展示了Seek类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onVideoSeek
import org.fourthline.cling.support.avtransport.callback.Seek; //导入依赖的package包/类
/**
* 视频跳转
*/
public void onVideoSeek(int schedule) {
String seekToTime = generateTime(schedule);
ActionCallback seek = new Seek(avTransportService, seekToTime) {
@Override
public void failure(ActionInvocation arg0, UpnpResponse arg1, String arg2) {
onFailureCallBack(SEEK, arg2);
}
@Override
public void success(ActionInvocation invocation) {
onSuccessCallBack(SEEK);
}
};
mUpnpService.getControlPoint().execute(seek);
}
示例2: seek
import org.fourthline.cling.support.avtransport.callback.Seek; //导入依赖的package包/类
public void seek(SeekMode mode, String target) {
Seek callback = new Seek(mAvTransportService, mode, target) {
@SuppressWarnings("rawtypes")
@Override
public void failure(ActionInvocation actionInvocation,
UpnpResponse response, String message) {
// TODO Auto-generated method stub
Log.e(LOG_TAG, "Seek failed! the reason is:" + message
+ "the response details is:" + response);
Utils.showToast(mContext, message);
}
};
if (mAvTransportService != null)
mAndroidUpnpService.getControlPoint().execute(callback);
}
示例3: commandSeek
import org.fourthline.cling.support.avtransport.callback.Seek; //导入依赖的package包/类
@Override
public void commandSeek(String relativeTimeTarget)
{
if (getAVTransportService() == null)
return;
controlPoint.execute(new Seek(getAVTransportService(), relativeTimeTarget) {
// TODO fix it, what is relativeTimeTarget ? :)
@Override
public void success(ActionInvocation invocation)
{
Log.v(TAG, "Success seeking !");
// TODO update player state
}
@Override
public void failure(ActionInvocation arg0, UpnpResponse arg1, String arg2)
{
Log.w(TAG, "Fail to seek ! " + arg2);
}
});
}
示例4: seekTo
import org.fourthline.cling.support.avtransport.callback.Seek; //导入依赖的package包/类
@Override
@SuppressLint("SimpleDateFormat")
public void seekTo(long millisecondsFromStart){
if(getDevice() == null) {
Log.d(getClass().getName(),
"No receiver device found: "
+ deviceId);
return;
}
Service<?, ?> service = getUpnpClient().getAVTransportService(getDevice());
if (service == null) {
Log.d(getClass().getName(),
"No AVTransport-Service found on Device: "
+getDevice().getDisplayString());
return;
}
Log.d(getClass().getName(), "Action seek ");
final ActionState actionState = new ActionState();
actionState.actionFinished = false;
SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm:ss");
dateFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
String relativeTimeTarget =dateFormat.format(millisecondsFromStart);
Seek seekAction = new Seek(new UnsignedIntegerFourBytes(id),service, relativeTimeTarget) {
@Override
public void success(ActionInvocation invocation)
{
//super.success(invocation);
Log.d(getClass().getName(), "success seek");
}
@Override
public void failure(ActionInvocation arg0, UpnpResponse arg1, String arg2)
{
Log.d(getClass().getName(), "fail seek");
}
};
getUpnpClient().getControlPoint().execute(seekAction);
}
示例5: seekTo
import org.fourthline.cling.support.avtransport.callback.Seek; //导入依赖的package包/类
@Override
@SuppressLint("SimpleDateFormat")
public void seekTo(long millisecondsFromStart){
if(getDevice() == null) {
Log.d(getClass().getName(),
"No receiver device found: "
+ deviceId);
return;
}
Service<?, ?> service = getUpnpClient().getAVTransportService(getDevice());
if (service == null) {
Log.d(getClass().getName(),
"No AVTransport-Service found on Device: "
+getDevice().getDisplayString());
return;
}
Log.d(getClass().getName(), "Action seek ");
final ActionState actionState = new ActionState();
actionState.actionFinished = false;
SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm:ss");
dateFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
String relativeTimeTarget =dateFormat.format(millisecondsFromStart);
Seek seekAction = new Seek(service, relativeTimeTarget) {
@Override
public void success(ActionInvocation invocation)
{
//super.success(invocation);
Log.d(getClass().getName(), "success seek");
}
@Override
public void failure(ActionInvocation arg0, UpnpResponse arg1, String arg2)
{
Log.d(getClass().getName(), "fail seek");
}
};
getUpnpClient().getControlPoint().execute(seekAction);
}
示例6: changePosition
import org.fourthline.cling.support.avtransport.callback.Seek; //导入依赖的package包/类
@Override
public void changePosition(int seconds) {
SimpleDateFormat df = new SimpleDateFormat("HH:mm:ss");
df.setTimeZone(TimeZone.getTimeZone("UTC"));
controlPoint.execute(new Seek(getTransportService(), SeekMode.REL_TIME, df.format(new Date(seconds * 1000))) {
@SuppressWarnings("rawtypes")
@Override
public void failure(ActionInvocation invocation, UpnpResponse operation, String defaultMessage) {
Log.w(TAG, "Seek failed: " + defaultMessage);
}
});
}