Skip to content

Commit

Permalink
add publisher video handler for device orientation change
Browse files Browse the repository at this point in the history
  • Loading branch information
darkpgx committed Nov 4, 2014
1 parent db2a2e9 commit 1b43fec
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
7 changes: 7 additions & 0 deletions src/js/OT.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,10 @@ window.OT =
@off( type, handler )

window.TB = OT
window.addEventListener "orientationchange", (->
setTimeout (->
OT.updateViews()
return
), 1000
return
), false
20 changes: 14 additions & 6 deletions www/opentok.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ window.OT = {

window.TB = OT;

window.addEventListener("orientationchange", (function() {
setTimeout((function() {
OT.updateViews();
}), 1000);
}), false);

var TBConnection;

TBConnection = (function() {
Expand Down Expand Up @@ -708,13 +714,15 @@ TBSession = (function() {
reason: "clientDisconnected"
});
this.trigger("streamDestroyed", streamEvent);
element = streamElements[stream.streamId];
if (element) {
element.parentNode.removeChild(element);
delete streamElements[stream.streamId];
TBUpdateObjects();
if (stream) {
element = streamElements[stream.streamId];
if (element) {
element.parentNode.removeChild(element);
delete streamElements[stream.streamId];
TBUpdateObjects();
}
delete this.streams[stream.streamId];
}
delete this.streams[stream.streamId];
return this;
};

Expand Down

0 comments on commit 1b43fec

Please sign in to comment.