javascript - new DOM creation when launching opentok video , make impossible to push button -
i'm developing mobile application opentok 2.2 beta new version , , angularjs 1.2.9
i got problem video conversation, when initialize it, can still push button terminate , when other user connected , new dom created video , can't access (can't push it) anymore button terminate conversation
the things don't understand , it's did opentok doc told me , used "insertmode:replace" , seems work "append" mode create child of targeted element...
source : http://tokbox.com/opentok/tutorials/subscribe-stream/js/ : -> subscribing stream
the javascript :
var publisher = tb.initpublisher($scope.apikey, 'layoutcontainer'); var session = tb.initsession($scope.apikey, $scope.sessionid); session.on({ streamcreated: function (event) { var subscriberproperties = {insertmode: "replace"}; session.subscribe(event.stream, 'layoutcontainer', subscriberproperties, function (error) { if (error) { console.log(error); } else { } }); }); session.connect($scope.token, function () { session.publish(publisher); })
here html :
<div class="main_view"> <div id="layoutcontainer"></div> <div id="boutonlayout"> <div style="text-align:center; margin-top: 5% ;height: 70px;"> <form name="sessionvideo" ng-submit="endcall()" novalidate> <div style="text-align:right; width:300px; bottom:80px;"> <input id="endcall" style="width:150px; font-size: 14px; height:50px; font-weight: bold; background-color: dodgerblue" type="submit" value="terminer l'appel"/> </div> </form> </div> </div>
css :
#layoutcontainer { background-color: #e3e3e3; position:absolute; top:5%;left:5%;right:5%;bottom:20%; } #boutonlayout { position:absolute; top:80%;left:5%;right:5%;bottom:0%; } .main_view{ position: absolute; top:5%; left:0; right:0; bottom:0; background-color: #fdfdfd; }
thanks reading , hope can me
okai , found solution , opentok plugin cordova didn't implement function "insertmode" yet....
so can put position relative object want new child
ie :
#boutonlayout { position:relative; top:80%;left:5%;right:5%;bottom:0%; }
that's temporary solution waiting release of feature
have day
Comments
Post a Comment