diff --git a/cocos2d/core/platform/CCScreen.js b/cocos2d/core/platform/CCScreen.js index 0a440f4d88..bb83d4e9e7 100644 --- a/cocos2d/core/platform/CCScreen.js +++ b/cocos2d/core/platform/CCScreen.js @@ -84,7 +84,7 @@ cc.screen = /** @lends cc.screen# */{ var i, l, val, map = this._fnMap, valL; for (i = 0, l = map.length; i < l; i++) { val = map[i]; - if (val && val[1] in document) { + if (val && (typeof document[val[1]] !== 'undefined')) { for (i = 0, valL = val.length; i < valL; i++) { this._fn[map[0][i]] = val[i]; } @@ -102,7 +102,7 @@ cc.screen = /** @lends cc.screen# */{ * @returns {Boolean} */ fullScreen: function () { - if(!this._supportsFullScreen) return false; + if(!this._supportsFullScreen) return false; else if( document[this._fn.fullscreenElement] === undefined || document[this._fn.fullscreenElement] === null ) return false; else diff --git a/cocos2d/core/videoplayer/CCSGVideoPlayer.js b/cocos2d/core/videoplayer/CCSGVideoPlayer.js index f69b549965..3f28bb1269 100644 --- a/cocos2d/core/videoplayer/CCSGVideoPlayer.js +++ b/cocos2d/core/videoplayer/CCSGVideoPlayer.js @@ -82,11 +82,11 @@ _ccsg.VideoPlayer = _ccsg.Node.extend(/** @lends _ccsg.VideoPlayer# */{ }, duration: function () { - return this._renderCmd.duration(); + return this._renderCmd.duration() || -1; }, currentTime: function() { - return this._renderCmd.currentTime(); + return this._renderCmd.currentTime() || -1; }, createDomElementIfNeeded: function () {