int streamId = conn.getStreamId();
if (StringUtils.isEmpty(name)) {
sendNSFailed(streamConn, StatusCodes.NS_FAILED, "The stream name may not be empty.", name, streamId);
return;
}
IStreamSecurityService security = (IStreamSecurityService) ScopeUtils.getScopeService(scope, IStreamSecurityService.class);
if (security != null) {
Set<IStreamPlaybackSecurity> handlers = security.getStreamPlaybackSecurity();
for (IStreamPlaybackSecurity handler : handlers) {
if (!handler.isPlaybackAllowed(scope, name, start, length, flushPlaylist)) {
sendNSFailed(streamConn, StatusCodes.NS_FAILED, "You are not allowed to play the stream.", name, streamId);
return;
}