However, I'm having a little problem. I have applied a publish/unpublish pattern on top of basically the example/mediaoup.py core code. I see, that you are creating VideoStreamTrack and AudioStreamTrack very early and apply the handles in an array on Device instantiation. Later, in the produce function a Producer is created and the tracks are provided again:
That works perfectly on publish, but when I try to unpublish such a stream by calling producer.close(), I cannot again publish like so after the close.
I'm either catching aiortc.exceptions.InvalidAccessError: Track already has a sender or pymediasoup.errors.InvalidStateError: track ended, depending on the state of the stopTracks flag (false/true).
Would you know a clean way to "reanimate" these Video/AudioStreamTracks for the next session?
I like this fine library, well written, indeed.
However, I'm having a little problem. I have applied a publish/unpublish pattern on top of basically the
example/mediaoup.py
core code. I see, that you are creatingVideoStreamTrack
andAudioStreamTrack
very early and apply the handles in an array onDevice
instantiation. Later, in theproduce
function aProducer
is created and the tracks are provided again:That works perfectly on publish, but when I try to unpublish such a stream by calling
producer.close()
, I cannot againpublish
like so after the close.I'm either catching
aiortc.exceptions.InvalidAccessError: Track already has a sender
orpymediasoup.errors.InvalidStateError: track ended
, depending on the state of thestopTracks
flag (false/true).Would you know a clean way to "reanimate" these Video/AudioStreamTracks for the next session?
TIA