Skip to content

Commit

Permalink
Added back missing deprecated fullscreen functions, and fixed a warni…
Browse files Browse the repository at this point in the history
…ng from using a deprecated method internally.

fixes #1451
  • Loading branch information
heff committed Sep 5, 2014
1 parent 18be3ef commit 5abff36
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/js/exports.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ goog.exportProperty(vjs.Player.prototype, 'preload', vjs.Player.prototype.preloa
goog.exportProperty(vjs.Player.prototype, 'remainingTime', vjs.Player.prototype.remainingTime);
goog.exportProperty(vjs.Player.prototype, 'supportsFullScreen', vjs.Player.prototype.supportsFullScreen);
goog.exportProperty(vjs.Player.prototype, 'currentType', vjs.Player.prototype.currentType);
goog.exportProperty(vjs.Player.prototype, 'requestFullScreen', vjs.Player.prototype.currentType);
goog.exportProperty(vjs.Player.prototype, 'cancelFullScreen', vjs.Player.prototype.currentType);
goog.exportProperty(vjs.Player.prototype, 'isFullScreen', vjs.Player.prototype.currentType);

goog.exportSymbol('videojs.MediaLoader', vjs.MediaLoader);
goog.exportSymbol('videojs.TextTrackDisplay', vjs.TextTrackDisplay);
Expand Down
2 changes: 1 addition & 1 deletion src/js/tracks.js
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ vjs.TextTrack.prototype.mode = function(){
* and restore it to its normal size when not in fullscreen mode.
*/
vjs.TextTrack.prototype.adjustFontSize = function(){
if (this.player_.isFullScreen()) {
if (this.player_.isFullscreen()) {
// Scale the font by the same factor as increasing the video width to the full screen window width.
// Additionally, multiply that factor by 1.4, which is the default font size for
// the caption track (from the CSS)
Expand Down
5 changes: 5 additions & 0 deletions test/unit/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ test('should be able to access expected player API methods', function() {
ok(player.usingNativeControls, 'usingNativeControls exists');
ok(player.isFullscreen, 'isFullscreen exists');

// Deprecated methods that should still exist
ok(player.requestFullScreen, 'requestFullScreen exists');
ok(player.isFullScreen, 'isFullScreen exists');
ok(player.cancelFullScreen, 'cancelFullScreen exists');

player.dispose();
});

Expand Down
4 changes: 2 additions & 2 deletions test/unit/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,14 +284,14 @@ test('should set controls and trigger events', function() {
// var player = PlayerTest.makePlayer();
// player.on('fullscreenchange', function(){
// ok(true, 'fullscreenchange event fired');
// ok(this.isFullScreen() === true, 'isFullScreen is true');
// ok(this.isFullscreen() === true, 'isFullscreen is true');
// ok(this.el().className.indexOf('vjs-fullscreen') !== -1, 'vjs-fullscreen class added');

// player.dispose();
// start();
// });

// player.requestFullScreen();
// player.requestFullscreen();
// });

test('should toggle user the user state between active and inactive', function(){
Expand Down

0 comments on commit 5abff36

Please sign in to comment.