本文整理汇总了Java中org.fourthline.cling.support.avtransport.callback.Play类的典型用法代码示例。如果您正苦于以下问题:Java Play类的具体用法?Java Play怎么用?Java Play使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Play类属于org.fourthline.cling.support.avtransport.callback包,在下文中一共展示了Play类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: play
import org.fourthline.cling.support.avtransport.callback.Play; //导入依赖的package包/类
public void play() {
Play callback = new Play(mAvTransportService) {
@SuppressWarnings("rawtypes")
@Override
public void failure(ActionInvocation actionInvocation,
UpnpResponse response, String message) {
// TODO Auto-generated method stub
Log.e(LOG_TAG, "Play failed! the reason is:" + message
+ "the response details is:" + response);
Utils.showToast(mContext, message);
}
};
if (mAvTransportService != null)
mAndroidUpnpService.getControlPoint().execute(callback);
}
示例2: play
import org.fourthline.cling.support.avtransport.callback.Play; //导入依赖的package包/类
public static void play() {
Device device = SystemManager.getInstance().getSelectedDevice();
//Check selected device
if (device == null) return;
Service avtService = device.findService(SystemManager.AV_TRANSPORT_SERVICE);
if (avtService != null) {
ControlPoint cp = SystemManager.getInstance().getControlPoint();
cp.execute(new Play(avtService) {
@Override
public void success(ActionInvocation invocation) {
Log.i(TAG, "Play success.");
}
@Override
public void failure(ActionInvocation arg0, UpnpResponse arg1, String arg2) {
Log.e(TAG, "Play failed");
}
});
}
}
示例3: start
import org.fourthline.cling.support.avtransport.callback.Play; //导入依赖的package包/类
@Override
public void start() {
if(error) {
Log.w(TAG, "Attempting to restart song");
startSong(downloadService.getCurrentPlaying(), true, 0);
return;
}
try {
controlPoint.execute(new Play(getTransportService()) {
@Override
public void success(ActionInvocation invocation) {
lastUpdate.set(System.currentTimeMillis());
downloadService.setPlayerState(PlayerState.STARTED);
}
@Override
public void failure(ActionInvocation actionInvocation, UpnpResponse upnpResponse, String msg) {
Log.w(TAG, "Failed to start playing: " + msg);
failedLoad();
}
});
} catch(Exception e) {
Log.w(TAG, "Failed to start", e);
}
}
示例4: commandPlay
import org.fourthline.cling.support.avtransport.callback.Play; //导入依赖的package包/类
@Override
public void commandPlay()
{
if (getAVTransportService() == null)
return;
controlPoint.execute(new Play(getAVTransportService()) {
@Override
public void success(ActionInvocation invocation)
{
Log.v(TAG, "Success playing ! ");
// TODO update player state
}
@Override
public void failure(ActionInvocation arg0, UpnpResponse arg1, String arg2)
{
Log.w(TAG, "Fail to play ! " + arg2);
}
});
}