I am getting a javascript object which contains method list but I am not able to access method.
I am integrating tokbox api and i want to call unpublish function when user wants to disconnect the stream.
Please find attached image of my object and whole function list. Please give me solutions as soon as possible.

- 3,998
- 3
- 20
- 29

- 100
- 1
- 9
-
very nice question i am also facing same type of problem – Sourabh Sep 09 '15 at 15:06
1 Answers
I don't see the problem from the screenshot attached. The session.unpublish(publisher)
method should work as expected. If it is not, can you please show what the errors or the bad behavior look like? Are you passing in the Publisher object? Also be aware that just because you unpublish, does not mean the video element on the page will disappear, for that you must call publisher.destroy()
. Lastly, the most simple solution would just be to call session.disconnect()
and that will automatically clean up by unpublishing and destroying the publisher.
I do see another error related to a parameter you passed to either OT.initPublisher(element, properties, completionHandler)
, session.publish(element, properties, completionHandler)
, or session.subscribe(stream, element, properties, completionHandler)
. In one of those, as the element
parameter, you are passing a reference to window
rather than a valid element from the page. You might also have intended to use a String that matches the id
attribute of an element on the page. Please fix that.

- 2,792
- 3
- 23
- 26