if (scope.getContext().getApplicationContext().containsBean(IRtmpSampleAccess.BEAN_NAME)) {
IRtmpSampleAccess sampleAccess = (IRtmpSampleAccess) scope.getContext().getApplicationContext().getBean(IRtmpSampleAccess.BEAN_NAME);
boolean videoAccess = sampleAccess.isVideoAllowed(scope);
boolean audioAccess = sampleAccess.isAudioAllowed(scope);
if (videoAccess || audioAccess) {
final Call call2 = new Call(null, "|RtmpSampleAccess", null);
Notify notify = new Notify();
notify.setCall(call2);
notify.setData(IoBuffer.wrap(new byte[] { 0x01, (byte) (audioAccess ? 0x01 : 0x00), 0x01, (byte) (videoAccess ? 0x01 : 0x00) }));
write(notify, connection.getStreamIdForChannel(id));
}
}
}
event.setCall(call);
} else {
final Call call = new Call(null, CALL_ON_STATUS, new Object[] { status });
event.setCall(call);
}
// send directly to the corresponding stream as for some status codes, no stream has been created and thus "getStreamByChannelId" will fail
write(event, connection.getStreamIdForChannel(id));
}