Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exporting tech.setPoster(). Fixes #1028 #1062

Merged
merged 1 commit into from
Mar 6, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/js/exports.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ goog.exportProperty(vjs.MediaTechController.prototype.features, 'volumeControl',
goog.exportProperty(vjs.MediaTechController.prototype.features, 'fullscreenResize', vjs.MediaTechController.prototype.features.fullscreenResize);
goog.exportProperty(vjs.MediaTechController.prototype.features, 'progressEvents', vjs.MediaTechController.prototype.features.progressEvents);
goog.exportProperty(vjs.MediaTechController.prototype.features, 'timeupdateEvents', vjs.MediaTechController.prototype.features.timeupdateEvents);
goog.exportProperty(vjs.MediaTechController.prototype, 'setPoster', vjs.MediaTechController.prototype.setPoster);


goog.exportSymbol('videojs.Html5', vjs.Html5);
goog.exportProperty(vjs.Html5, 'Events', vjs.Html5.Events);
Expand Down
8 changes: 8 additions & 0 deletions src/js/media/media.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,14 @@ vjs.MediaTechController.prototype.onTap = function(){
this.player().userActive(!this.player().userActive());
};

/**
* Provide a default setPoster method for techs
*
* Poster support for techs should be optional, so we don't want techs to
* break if they don't have a way to set a poster.
*/
vjs.MediaTechController.prototype.setPoster = function(){};

vjs.MediaTechController.prototype.features = {
'volumeControl': true,

Expand Down
10 changes: 10 additions & 0 deletions test/unit/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,16 @@ test('should be able to access expected component API methods', function() {
ok(comp.buildCSSClass, 'buildCSSClass exists');
});

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

ok(techProto.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');
});

test('should export ready api call to public', function() {
var videoTag = PlayerTest.makeTag();

Expand Down