Detect Red5 Broadcaster disconnection by network failure - red5

How can i detect that a broadcaster has a network failure and disconnected from Red5 server? streamBroadcastClose method doesnt help me. I looked at the red5 reference but couldnt find any event that detects the broadcaster disconnection.

If there's a network disconnect, you're more likely to get a socket or write exception; there is no Flash NetConnection event specific to this type of failure that I know of.

Related

Send and receive iot-hub messages

I am working on a project based on the azure sphere kit where I want to control a motor from a web application. I managed to send the command to the iot hub and the build in monitor shows that the message is received by the iot hub. Now, my question is: How can I forward this message to the board? I have to mention that this is my first experience with the iot-hub so please dont judge me if it is a stupid question.:) Here is the confirmation that the message is received by the iothub
If you want to communicate with your Azure Sphere from Azure IoT Hub, you're talking about Cloud-to-device communication. There are three different ways to do this communication:
Direct Methods
Device Twin Desired Properties
Cloud-to-device (C2D) messages
Microsoft documented them here. This document also lists the different considerations for each of the three methods.
To forward the IoT Hub message that you mentioned in your question, a good start would be to write an Azure Function that listens to the IoT Hub output and send that to the device using one of the three methods above. You can find an example for the Azure Function IoT Hub trigger here
Adding few more detailed options in this scenario to the above responses.
Scenario 1: You may be interested in configuring your devices from your back-end service(s) as your web application. To synchronize state information between a device and an IoT hub, you use device twins. A desired property is set by a back-end application and read by a device. A reported property is set by a device and read by a back-end application. A tag is set by a back-end application and is never sent to a device. You use tags to organize your devices. Long-running commands intended to put the device into a certain desired state. For example, set the telemetry send interval to 30 minutes. This completes your E2E state synchronization scenario : Web-Application<=>IoT Device, Ref Link
Question: How can I forward this message to the board?
Scenario 2: You may be interested in direct method to control a device connected to your IoT hub. You can use direct methods to remotely change the behavior of devices connected to your IoT hub. Commands that require immediate confirmation, such as turning on a fan.
Requirements:
-->IoT Device: To receive the direct method calls, the applications running on IoT Device connect to a device-specific endpoint on your IoT hub.
HostName={YourIoTHubName}.azure-devices.net;DeviceId=MyNodeDevice;SharedAccessKey={YourSharedAccessKey}
-->Web-Application: To call a direct method on a device, your Web application connects to service-side endpoint on your IoT hub.
HostName={YourIoTHubName}.azure-devices.net;SharedAccessKeyName=service;SharedAccessKey={YourSharedAccessKey}
Direct Method calls: Points to be noted. Please visit the link: detailed comparison of the various cloud-to-device communication options.
The maximum direct method payload size is 128 KB.
Disconnected devices are not contacted. The solution back end is notified that the device is not connected.
Ref Link
If you need further help in this matter, please comment in the below section and we will be happy to help you on this forum.

WebRTC not working behind a VPN

The video chat works with most users, but I couldn't get a video chat to work with one of the user of my website.
She couldn't see me, and I couldn't see her.
I don't have any details how it failed like if it was at the SDP negotiation, or if she failed a connection to our TURN server (coturn), but hopefully someone has made it work for VPN users and has an answer for this issue.
ICE failures can happen, no matter what. The ice connection state will go to failed and simplewebrtc will give you an iceFailed event here. You'll need to handle that in your UI somehow.

Get a stream of a remote camera

I need to start a live stream in a remote computer connected to a webcam,
then connect to that remote ip address and see the live stream, like a security webcam more or less.
On my client i want to be able to see the stream in my browser.
What I've tried so far:
VLC on the remote pc: I start the stream (MMS, HTTP or RSTP) and then I encapsulate the stream as object in a html page.
This works, but I have a high latency and not all the browsers support x-vlc-plugin.
WebRTC. This seemed to me the best solution. Direct stream, very low latency.
I tried all the solutions I found in internet, that also integrate node.js. I tried also to build some code myself but the problem is that:
I start the stream on the "server", the remote pc.
When i go to the client, I type in the browser the ip address and port of the remote PC. In theory I should be able to see the REMOTE stream, but instead the browser asks for permission to use my LOCAL camera!
Do you have some hints or solutions about? What am I doing wrong?
Last project I tried:
https://github.com/xat/webcam-binaryjs-demo
In this project:
https://webrtc.github.io/samples/src/content/peerconnection/multiple-relay/
the developer uses a relay of the stream.
Buttons work but I don't know how to use this, that is how to catch the relay and display it on the client.
Thank you for your suggestions.
webRTC has three common API
getUserMedia : for communication and streaming between camera/mic with browser (request permission for access to camera/mic)
https://developer.mozilla.org/en-US/docs/Web/API/Navigator/getUserMedia
RTCDataChannel : data channel for send/receive any type of data on connection
https://developer.mozilla.org/en-US/docs/Web/API/RTCDataChannel
RTCPeerConnection : for creating peer-to-peer connection
https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection
you don't need getUserMedia
find getUserMedia() , this method send access request for camera and microphone to user , you can set both boolean false , or remove it carefully
navigator.getUserMedia({
video:false,
audio:true,
},function(mediaStream){...

When does Windows cancel an in-flight WDF request?

I am writing a Windows device driver using WDF (KMDF) for a USB3 device that transfers data in large chunks at a time. I've written a user-level application that tests this functionality, and for the most part, things work.
The problem I encounter is this: I have found that when I force-close (CTRL+C from a cmd window) the application mid-transfer, the on-going data transfer at the time of cancel immediately stops and the host seems to simply stop communicating with that endpoint. I have observed this on a USB bus trace. The requests return in the function driver as "STATUS_CANCELLED"
I have looked at other similar third party devices and ran their test applications with their drivers on those devices and found that when I kill their test applications mid-data-transfer, the transfer completes before the application closes.
My question:
How/when does Windows decide to kill in-flight requests when applications are closed?
Is there any way to mark the request as "uncancelable"? I've scoured the documentation but found nothing that suggests I need to do something to keep requests from being cancelled behind the scenes mid-transfer.
Any insights appreciated, thanks.
It's not about the device driver; it's about the way the console application handles the Ctrl-C event. The console application must trap the Ctrl-C event, and wait for the transfer to finish before it exits.

USB Endpoint Stalled Error

I am getting "endpoint stalled error" in my CDC device. The usb stack is detecting the cable. The state is set as running but the errorcode is set as 0x11 which indicates 'USB_ENDPOINT_STALLED'. I verified and found that the endpoints has been assigned properly.
What would be scenarios when "endpoint stalled error" would be reported?
How to handle this?
Please advise!
STALL is a very common error and there is no general answer on this. You can reset the pipe , but i doubt it will help, probably your device is returning stall because your are not operating the device correctly.
Do you have an USB bus analyzer ? If yes please post the log so we can assist you better if not you can use a software bus analyzers like usb snoop.