1
0
mirror of https://github.com/videojs/video.js.git synced 2024-11-26 08:51:09 +02:00

Exporting tech.setPoster(). Fixes #1028

This commit is contained in:
Steve Heffernan 2014-03-05 16:08:49 -08:00
parent d47435a18f
commit 2005fe2136
3 changed files with 20 additions and 0 deletions

View File

@ -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);

View File

@ -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,

View File

@ -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();