Type of Video for custom streams

Hi,
using an RPC implementation to publish a stream (like in the Android example) the typeOfVideo can be set to any string. This is very useful when there are different custom streams types to handle. Using the javascript sdk, when publishing a video from a custom stream the typeOfVideo is fixed at CUSTOM, so when camera and screen streams are managed directly with getUserMedia without using openvidu, receivers cannot tell which source originated the stream. Is there a way to bypass this limitation? something like a tag that can be set to the stream from the publisher?

I’d prefer not using signals to inform subscribers to avoid the need to synch new connected participants on previous published streams.

Thanks

Hello,

You’ve mentioned the Javascript SDK so I recommend you to use client-side metadata, see here:

You can use a JSON encoded to string like: { source: 'MY_SOURCE' }, then this will be available on the streamCreated event as event.stream.connection.data where you can decode it back to JSON. No signals required!

Cheers,
Mihail

Hi @mihailj ,

thank you for your suggestion, but client side metadata are set once on connection and, as far as I understand, cannot be changed during the session without performing a reconnection. It’s a good place to put sender informations like identity data about the participant, but the participant can publish different streams during the session, so I think I need something like the client-side data but at publisher/subscriber level or at stream level.