binding makes no difference - put a null check in to catch the rogue exception
This commit is contained in:
parent
da6c5653b1
commit
fe0707535c
|
@ -27,7 +27,7 @@ module.exports = React.createClass({
|
||||||
mixins: [VideoViewController],
|
mixins: [VideoViewController],
|
||||||
|
|
||||||
componentWillMount: function() {
|
componentWillMount: function() {
|
||||||
dis.register(this.onAction.bind(this));
|
dis.register(this.onAction);
|
||||||
},
|
},
|
||||||
|
|
||||||
getRemoteVideoElement: function() {
|
getRemoteVideoElement: function() {
|
||||||
|
@ -41,6 +41,9 @@ module.exports = React.createClass({
|
||||||
onAction: function(payload) {
|
onAction: function(payload) {
|
||||||
switch (payload.action) {
|
switch (payload.action) {
|
||||||
case 'video_fullscreen':
|
case 'video_fullscreen':
|
||||||
|
if (!this.refs.container) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
var element = this.refs.container.getDOMNode();
|
var element = this.refs.container.getDOMNode();
|
||||||
var requestMethod = element.requestFullScreen || element.webkitRequestFullScreen || element.mozRequestFullScreen || element.msRequestFullscreen;
|
var requestMethod = element.requestFullScreen || element.webkitRequestFullScreen || element.mozRequestFullScreen || element.msRequestFullscreen;
|
||||||
requestMethod.call(element);
|
requestMethod.call(element);
|
||||||
|
|
Loading…
Reference in New Issue