2013-01-25 17:36:40 -08:00
|
|
|
// Fake a media playback tech controller so that player tests
|
2013-01-17 20:33:53 -05:00
|
|
|
// can run without HTML5 or Flash, of which PhantomJS supports neither.
|
|
|
|
|
2013-01-25 17:36:40 -08:00
|
|
|
/**
|
|
|
|
* @constructor
|
|
|
|
*/
|
2013-04-09 13:43:35 -07:00
|
|
|
vjs.MediaFaker = vjs.MediaTechController.extend({
|
|
|
|
init: function(player, options, onReady){
|
|
|
|
vjs.MediaTechController.call(this, player, options, onReady);
|
2013-01-17 20:33:53 -05:00
|
|
|
|
2013-04-09 13:43:35 -07:00
|
|
|
this.triggerReady();
|
|
|
|
}
|
|
|
|
});
|
2013-01-17 20:33:53 -05:00
|
|
|
|
|
|
|
// Support everything
|
|
|
|
vjs.MediaFaker.isSupported = function(){ return true; };
|
|
|
|
vjs.MediaFaker.canPlaySource = function(srcObj){ return true; };
|
2013-04-09 13:18:55 -07:00
|
|
|
|
2013-01-17 20:33:53 -05:00
|
|
|
vjs.MediaFaker.prototype.createEl = function(){
|
2013-04-09 13:43:35 -07:00
|
|
|
var el = vjs.MediaTechController.prototype.createEl.call(this, 'div', {
|
2013-01-17 20:33:53 -05:00
|
|
|
className: 'vjs-tech'
|
|
|
|
});
|
2013-04-04 18:56:52 -04:00
|
|
|
if (this.player().poster()) {
|
2013-04-04 09:55:27 -04:00
|
|
|
// transfer the poster image to mimic HTML
|
2013-04-04 18:56:52 -04:00
|
|
|
el.poster = this.player().poster();
|
2013-04-04 09:55:27 -04:00
|
|
|
}
|
2013-01-17 20:33:53 -05:00
|
|
|
|
|
|
|
vjs.insertFirst(el, this.player_.el());
|
|
|
|
|
|
|
|
return el;
|
|
|
|
};
|
|
|
|
|
|
|
|
vjs.MediaFaker.prototype.currentTime = function(){ return 0; };
|
|
|
|
vjs.MediaFaker.prototype.volume = function(){ return 0; };
|
2013-05-02 17:07:05 -07:00
|
|
|
vjs.MediaFaker.prototype.muted = function(){ return false; };
|
2013-01-17 20:33:53 -05:00
|
|
|
|
2013-04-09 13:43:35 -07:00
|
|
|
// Export vars for Closure Compiler
|
|
|
|
vjs['MediaFaker'] = vjs.MediaFaker;
|
|
|
|
vjs['MediaFaker']['isSupported'] = vjs.MediaFaker.isSupported;
|
|
|
|
vjs['MediaFaker']['canPlaySource'] = vjs.MediaFaker.canPlaySource;
|