Skip to content

Commit

Permalink
Exported missing source handler functions. closes #1787
Browse files Browse the repository at this point in the history
  • Loading branch information
heff committed Jan 12, 2015
1 parent 881be6f commit a3b12d9
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ CHANGELOG
=========

## HEAD (Unreleased)
_(none)_
* Exported missing source handler functions ([view](https://github.com/videojs/video.js/pull/1787))

--------------------

Expand Down
11 changes: 10 additions & 1 deletion src/js/exports.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,14 @@ goog.exportSymbol('videojs.CaptionsButton', vjs.CaptionsButton);
goog.exportSymbol('videojs.ChaptersButton', vjs.ChaptersButton);

goog.exportSymbol('videojs.MediaTechController', vjs.MediaTechController);
goog.exportProperty(vjs.MediaTechController, 'withSourceHandlers', vjs.MediaTechController.withSourceHandlers);
goog.exportProperty(vjs.MediaTechController.prototype, 'featuresVolumeControl', vjs.MediaTechController.prototype.featuresVolumeControl);
goog.exportProperty(vjs.MediaTechController.prototype, 'featuresFullscreenResize', vjs.MediaTechController.prototype.featuresFullscreenResize);
goog.exportProperty(vjs.MediaTechController.prototype, 'featuresPlaybackRate', vjs.MediaTechController.prototype.featuresPlaybackRate);
goog.exportProperty(vjs.MediaTechController.prototype, 'featuresProgressEvents', vjs.MediaTechController.prototype.featuresProgressEvents);
goog.exportProperty(vjs.MediaTechController.prototype, 'featuresTimeupdateEvents', vjs.MediaTechController.prototype.featuresTimeupdateEvents);
goog.exportProperty(vjs.MediaTechController.prototype, 'setPoster', vjs.MediaTechController.prototype.setPoster);


goog.exportSymbol('videojs.Html5', vjs.Html5);
goog.exportProperty(vjs.Html5, 'Events', vjs.Html5.Events);
goog.exportProperty(vjs.Html5, 'isSupported', vjs.Html5.isSupported);
Expand All @@ -154,7 +154,11 @@ goog.exportProperty(vjs.Html5.prototype, 'enterFullScreen', vjs.Html5.prototype.
goog.exportProperty(vjs.Html5.prototype, 'exitFullScreen', vjs.Html5.prototype.exitFullScreen);
goog.exportProperty(vjs.Html5.prototype, 'playbackRate', vjs.Html5.prototype.playbackRate);
goog.exportProperty(vjs.Html5.prototype, 'setPlaybackRate', vjs.Html5.prototype.setPlaybackRate);
// Source Handler Functions
goog.exportProperty(vjs.Html5, 'registerSourceHandler', vjs.Html5.registerSourceHandler);
goog.exportProperty(vjs.Html5, 'selectSourceHandler', vjs.Html5.selectSourceHandler);
goog.exportProperty(vjs.Html5.prototype, 'setSource', vjs.Html5.prototype.setSource);
goog.exportProperty(vjs.Html5.prototype, 'disposeSourceHandler', vjs.Html5.prototype.disposeSourceHandler);

goog.exportSymbol('videojs.Flash', vjs.Flash);
goog.exportProperty(vjs.Flash, 'isSupported', vjs.Flash.isSupported);
Expand All @@ -163,6 +167,11 @@ goog.exportProperty(vjs.Flash, 'onReady', vjs.Flash['onReady']);
goog.exportProperty(vjs.Flash, 'embed', vjs.Flash.embed);
goog.exportProperty(vjs.Flash, 'version', vjs.Flash.version);
goog.exportProperty(vjs.Flash.prototype, 'setSource', vjs.Flash.prototype.setSource);
// Source Handler Functions
goog.exportProperty(vjs.Flash, 'registerSourceHandler', vjs.Flash.registerSourceHandler);
goog.exportProperty(vjs.Flash, 'selectSourceHandler', vjs.Flash.selectSourceHandler);
goog.exportProperty(vjs.Flash.prototype, 'setSource', vjs.Flash.prototype.setSource);
goog.exportProperty(vjs.Flash.prototype, 'disposeSourceHandler', vjs.Flash.prototype.disposeSourceHandler);

goog.exportSymbol('videojs.TextTrack', vjs.TextTrack);
goog.exportProperty(vjs.TextTrack.prototype, 'label', vjs.TextTrack.prototype.label);
Expand Down
19 changes: 17 additions & 2 deletions test/unit/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,19 +94,34 @@ test('should be able to access expected component API methods', function() {
});

test('should be able to access expected MediaTech API methods', function() {
var techProto = videojs.MediaTechController.prototype;
var media = videojs.MediaTechController;
var mediaProto = videojs.MediaTechController.prototype;
var html5 = videojs.Html5;
var html5Proto = videojs.Html5.prototype;
var flash = videojs.Flash;
var flashProto = videojs.Flash.prototype;

ok(techProto.setPoster, 'setPoster should exist on the Media tech');
ok(mediaProto.setPoster, 'setPoster should exist on the Media tech');
ok(html5Proto.setPoster, 'setPoster should exist on the HTML5 tech');
ok(flashProto.setPoster, 'setPoster should exist on the Flash tech');

ok(videojs.Html5.patchCanPlayType, 'patchCanPlayType should exist for HTML5');
ok(videojs.Html5.unpatchCanPlayType, 'unpatchCanPlayType should exist for HTML5');

// Source Handler Functions
ok(media.withSourceHandlers, 'withSourceHandlers should exist for Media Tech');

ok(videojs.Html5.canPlaySource, 'canPlaySource should exist for HTML5');
ok(videojs.Html5.registerSourceHandler, 'registerSourceHandler should exist for Html5');
ok(videojs.Html5.selectSourceHandler, 'selectSourceHandler should exist for Html5');
ok(videojs.Html5.prototype.setSource, 'setSource should exist for Html5');
ok(videojs.Html5.prototype.disposeSourceHandler, 'disposeSourceHandler should exist for Html5');

ok(videojs.Flash.canPlaySource, 'canPlaySource should exist for Flash');
ok(videojs.Flash.registerSourceHandler, 'registerSourceHandler should exist for Flash');
ok(videojs.Flash.selectSourceHandler, 'selectSourceHandler should exist for Flash');
ok(videojs.Flash.prototype.setSource, 'setSource should exist for Flash');
ok(videojs.Flash.prototype.disposeSourceHandler, 'disposeSourceHandler should exist for Flash');
});

test('should export ready api call to public', function() {
Expand Down

0 comments on commit a3b12d9

Please sign in to comment.