Extension talk:TimedMediaHandler
Latest comment: 15 days ago by Alien333 in topic Using VideoJS
Using VideoJS
editI'm having trouble initialising it.
The styling, specifically, is jumbled up (controls not styled, and progress bar disappearing). What am I doing wrong? — Alien 3
3 3 18:18, 1 February 2025 (UTC)
$(".mw-body").append(`<div id="vid"></div>`)
var player;
// Load the appropriate modules in ResourceLoader
mw.loader.using( 'ext.tmh.videojs-ogvjs' ).then( function () {
// Load ogvjs if necessary; when this promise resolves,
// all necessary code has been loaded
return mw.OgvJsSupport.loadIfNeeded();
} ).then( function () {
player = videojs( 'vid', {
controls: true,
autoplay: false,
poster: '//upload.wikimedia.org/wikipedia/commons/thumb/d/de/Longines_Chronicles_with_Leo_Mates_1954_ARC-96010.ogv/400px--Longines_Chronicles_with_Leo_Mates_1954_ARC-96010.ogv.jpg',
sources: ["//upload.wikimedia.org/wikipedia/commons/d/de/Longines_Chronicles_with_Leo_Mates_1954_ARC-96010.ogv" ],
// Ogv.js-specific configuration
ogvjs: {
base: mw.OgvJsSupport.basePath()
}
} );
} );
ought to work, it's nearly the doc. — Alien 3
3 3 18:19, 1 February 2025 (UTC)
- (Pinging @Brooke Vibber, as one of the authors, as I'm not sure anyone actually looks here.) — Alien 3
3 3 19:08, 1 February 2025 (UTC)