本文整理汇总了Java中org.red5.server.api.stream.IPlayItem类的典型用法代码示例。如果您正苦于以下问题:Java IPlayItem类的具体用法?Java IPlayItem怎么用?Java IPlayItem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IPlayItem类属于org.red5.server.api.stream包,在下文中一共展示了IPlayItem类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: replace
import org.red5.server.api.stream.IPlayItem; //导入依赖的package包/类
/** {@inheritDoc} */
public boolean replace(IPlayItem oldItem, IPlayItem newItem) {
boolean result = false;
read.lock();
try {
int index = items.indexOf(oldItem);
items.remove(index);
items.set(index, newItem);
result = true;
} catch (Exception e) {
} finally {
read.unlock();
}
return result;
}
示例2: replace
import org.red5.server.api.stream.IPlayItem; //导入依赖的package包/类
/** {@inheritDoc} */
public boolean replace(IPlayItem oldItem, IPlayItem newItem) {
boolean result = false;
read.lock();
try {
int index = items.indexOf(oldItem);
items.remove(index);
items.set(index, newItem);
result = true;
} catch (Exception e) {
} finally {
read.unlock();
}
return result;
}
示例3: sendResetStatus
import org.red5.server.api.stream.IPlayItem; //导入依赖的package包/类
/**
* Send reset status for item
*
* @param item
* Playlist item
*/
private void sendResetStatus(IPlayItem item) {
Status reset = new Status(StatusCodes.NS_PLAY_RESET);
reset.setClientid(streamId);
reset.setDetails(item.getName());
reset.setDesciption(String.format("Playing and resetting %s.", item.getName()));
doPushMessage(reset);
}
示例4: sendStartStatus
import org.red5.server.api.stream.IPlayItem; //导入依赖的package包/类
/**
* Send playback start status notification
*
* @param item
* Playlist item
*/
private void sendStartStatus(IPlayItem item) {
Status start = new Status(StatusCodes.NS_PLAY_START);
start.setClientid(streamId);
start.setDetails(item.getName());
start.setDesciption(String.format("Started playing %s.", item.getName()));
doPushMessage(start);
}
示例5: sendStopStatus
import org.red5.server.api.stream.IPlayItem; //导入依赖的package包/类
/**
* Send playback stoppage status notification
*
* @param item
* Playlist item
*/
private void sendStopStatus(IPlayItem item) {
Status stop = new Status(StatusCodes.NS_PLAY_STOP);
stop.setClientid(streamId);
stop.setDesciption(String.format("Stopped playing %s.", item.getName()));
stop.setDetails(item.getName());
doPushMessage(stop);
}
示例6: sendSeekStatus
import org.red5.server.api.stream.IPlayItem; //导入依赖的package包/类
/**
* Send seek status notification
*
* @param item
* Playlist item
* @param position
* Seek position
*/
private void sendSeekStatus(IPlayItem item, int position) {
Status seek = new Status(StatusCodes.NS_SEEK_NOTIFY);
seek.setClientid(streamId);
seek.setDetails(item.getName());
seek.setDesciption(String.format("Seeking %d (stream ID: %d).", position, streamId));
doPushMessage(seek);
}
示例7: sendPauseStatus
import org.red5.server.api.stream.IPlayItem; //导入依赖的package包/类
/**
* Send pause status notification
*
* @param item
* Playlist item
*/
private void sendPauseStatus(IPlayItem item) {
Status pause = new Status(StatusCodes.NS_PAUSE_NOTIFY);
pause.setClientid(streamId);
pause.setDetails(item.getName());
doPushMessage(pause);
}
示例8: sendResumeStatus
import org.red5.server.api.stream.IPlayItem; //导入依赖的package包/类
/**
* Send resume status notification
*
* @param item
* Playlist item
*/
private void sendResumeStatus(IPlayItem item) {
Status resume = new Status(StatusCodes.NS_UNPAUSE_NOTIFY);
resume.setClientid(streamId);
resume.setDetails(item.getName());
doPushMessage(resume);
}
示例9: sendPublishedStatus
import org.red5.server.api.stream.IPlayItem; //导入依赖的package包/类
/**
* Send published status notification
*
* @param item
* Playlist item
*/
private void sendPublishedStatus(IPlayItem item) {
Status published = new Status(StatusCodes.NS_PLAY_PUBLISHNOTIFY);
published.setClientid(streamId);
published.setDetails(item.getName());
doPushMessage(published);
}
示例10: sendUnpublishedStatus
import org.red5.server.api.stream.IPlayItem; //导入依赖的package包/类
/**
* Send unpublished status notification
*
* @param item
* Playlist item
*/
private void sendUnpublishedStatus(IPlayItem item) {
Status unpublished = new Status(StatusCodes.NS_PLAY_UNPUBLISHNOTIFY);
unpublished.setClientid(streamId);
unpublished.setDetails(item.getName());
doPushMessage(unpublished);
}
示例11: sendStreamNotFoundStatus
import org.red5.server.api.stream.IPlayItem; //导入依赖的package包/类
/**
* Stream not found status notification
*
* @param item
* Playlist item
*/
private void sendStreamNotFoundStatus(IPlayItem item) {
Status notFound = new Status(StatusCodes.NS_PLAY_STREAMNOTFOUND);
notFound.setClientid(streamId);
notFound.setLevel(Status.ERROR);
notFound.setDetails(item.getName());
doPushMessage(notFound);
}
示例12: sendInsufficientBandwidthStatus
import org.red5.server.api.stream.IPlayItem; //导入依赖的package包/类
/**
* Insufficient bandwidth notification
*
* @param item
* Playlist item
*/
private void sendInsufficientBandwidthStatus(IPlayItem item) {
Status insufficientBW = new Status(StatusCodes.NS_PLAY_INSUFFICIENT_BW);
insufficientBW.setClientid(streamId);
insufficientBW.setLevel(Status.WARNING);
insufficientBW.setDetails(item.getName());
insufficientBW.setDesciption("Data is playing behind the normal speed.");
doPushMessage(insufficientBW);
}
示例13: sendVODInitCM
import org.red5.server.api.stream.IPlayItem; //导入依赖的package包/类
/**
* Send VOD init control message
*
* @param item
* Playlist item
*/
private void sendVODInitCM(IPlayItem item) {
OOBControlMessage oobCtrlMsg = new OOBControlMessage();
oobCtrlMsg.setTarget(IPassive.KEY);
oobCtrlMsg.setServiceName("init");
Map<String, Object> paramMap = new HashMap<String, Object>(1);
paramMap.put("startTS", (int) item.getStart());
oobCtrlMsg.setServiceParamMap(paramMap);
msgInReference.get().sendOOBControlMessage(this, oobCtrlMsg);
}
示例14: addItem
import org.red5.server.api.stream.IPlayItem; //导入依赖的package包/类
/** {@inheritDoc} */
public void addItem(IPlayItem item) {
write.lock();
try {
items.add(item);
} finally {
write.unlock();
}
}
示例15: getItem
import org.red5.server.api.stream.IPlayItem; //导入依赖的package包/类
/** {@inheritDoc} */
public IPlayItem getItem(int index) {
read.lock();
try {
return items.get(index);
} catch (IndexOutOfBoundsException e) {
return null;
} finally {
read.unlock();
}
}