2

I'm using OpenTok Web Client SDK and OpenTok .NET Server SDK to generate TokBox sessions that are always going to be multiparty conferences with video being published by many.

I'd like to limit the number of streams that can be published and somehow set that as a session property. Right now I know this value - the number of current publishers - in the client side, and I can of course prevent a new user to publish, but I'm running into this scenario where two users try to publish at the same time, and both are accepted. Ideally the user who published the very first of the two should be accepted, so I'm wondering if there is a way to set this property in the TokBox "server side", as a session property, so the server would reject a new publisher if max. reached.

Please notice that I don't have any server state on my own that keeps track of the created sessions nor how many publishers they have, etc.

Thanks!

elbecita
  • 2,408
  • 14
  • 27

1 Answers1

3

Adam here from the OpenTok team.

There is no server-side setting available in OpenTok to limit the number of streams allowed. You could do something like I suggest in this answer though. Where you keep track of streamCreated Events and look at the creationTime property and if your stream is the n-th then you unpublish. Or you can forceUnpublish the n-th stream.

Adam Ullman
  • 1,397
  • 6
  • 10
  • Thanks Adam, I guess we will have to go with that suggestion. It'd be really useful to have that session setting available at some point, though. :) – elbecita Mar 29 '19 at 17:12
  • 1
    Thanks, I'll bring it up with our product team as a feature request. – Adam Ullman Apr 01 '19 at 00:47