jeudi 26 février 2015

Positioning Subscriber in OpenTok


I am trying to position the subscriber video with OpenTok, unfortunately the code they provide in their tutorial does not appear to be working. The code I have at the moment, based on their advice is:



<script>
var session = OT.initSession(XXXXX, "XXXXXXX");

session.on("streamCreated", function(event) {
session.subscribe(event.stream);
});
// Replace with a valid token.
// See http://ift.tt/1LLQV2P
session.connect("XXXXXXX", function(error) {
var publisher = OT.initPublisher("video-box",{width:400, height:300})
session.publish(publisher);
var subscriber = session.subscribe(stream,"sub-box",{width:400, height:300})
session.publish(publisher);
});
</script>


Please note I have replaced sessions ids, API key etc. with XXXX.


I have two divs with ID video-box and sub-box. Is there something really obvious that missing?





Aucun commentaire:

Enregistrer un commentaire