Page MenuHomePhabricator

Provide a JavaScript API to activate TMH/create a player on a given video/audio and document it
Closed, InvalidPublic

Description

Original bug title:
Provide a JavaScript API to activate TMH/create a player on a given video/audio and document it

The issue:
User- and gadget-scripts, and when option "use live preview" in the user's preferences is activated (that's why this is not just an enhancement), no player can be / is created on dynamically created/inserted content.

Something simple like tmh.makePlayer({

node: // optional video node to convert to a player
file: // name of the file that should be played

})

would be welcome.


Version: unspecified
Severity: enhancement

Details

Reference
bz50980

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 2:00 AM
bzimport set Reference to bz50980.

Please put the documentation at [[:mw:Extension:TimedMediaHandler/API]]. Thank you.

mdale wrote:

We do have a jQuery api: $('#videoTarget').embedPlayer( callback ) and it supports loading sources via mwtitle ... So something like:

$('<video>')
.addClass('kskin')
.css({

width:'400px',
height:'300px'

})
.attr({

'data-mwtitle' : "0DRIVE.ogv", // the wiki title name

})
.appendTo('#mw-content-text') must append to dom before calling embedPlayer
.embedPlayer();
rewrites the video tag with player interface, loads sources via mwtitle attribute.

Would "work" but its missing poster and duration hint, so we should probably enhance to load thous items from mwtitle as well ( if not defined in the video tag )

TheDJ claimed this task.
TheDJ subscribed.

There already is class that does this as @mdale mentioned, but most of this is simply not working as expected due to T74675.

Because of this closing as invalid, as the problem is basically 'elsewhere', which is already tracked.