Javascript OpenTok doesn't release media

240 Views Asked by At

I created a video web application that works properly but when I try to disconnect the session, the video and the audio disappeared but the camera remains blocked on both sides of my application and I'm not able to use the camera with another application until I reload the page.

I receive this message:

OpenTok:NativeVideoElementWrapper:1:warn Video element paused, auto-resuming. If you intended to do this, use publishVideo(false) or subscribeToVideo(false) instead.

This is my disconnect method on both sides of my application:

        if(this.publisher){
            this.session.unpublish(this.publisher)
        }
        if(this.subscriber){
            this.session.unsubscribe(this.subscriber)
        }

        this.session.disconnect()

        this.session.off('streamCreated')

EDIT:

I solved the issue: I have to call this.publisher.destroy() after unpublishing it

0

There are 0 best solutions below