developarvin
developarvin

Reputation: 5059

OpenTok - How to unsubscribe manually?

I have asked a related question before

OpenTok - How to publish/unpublish manually?

Now I am struggling to do the unsubscribe manually.

http://www.tokbox.com/opentok/api/tools/js/documentation/api/Session.html#unsubscribe

I have already followed the code but I still see the video. It is supposed to remove the video right?

EDIT: I discovered a mistake in the example code in the unsubscribe section. unsubscribe() accepts subscriber objects but the code passes a stream object.

Upvotes: 2

Views: 1877

Answers (1)

songz
songz

Reputation: 2092

In case anyone else has the some error, heres some sample code snippet:
var subscriber;

After you create a subscriber:
subscriber = session.subscribe( streamObject );

To unsubscribe:
session.unsubscribe(subscriber);

Upvotes: 3

Related Questions