Skip to content

player.rebuild resetting position of closed captions button #288

Description

@joe-allen-89

Subject of the issue

Currently any plugin extending media view and requiring the player to be rebuilt (when clicking between multiple videos) _playerOptions.features is ignored and the closed captions button is moved to the end of the controls.

This is due to the captions button being removed then appended to controls on buildtracks -

player.captionsButton =
$('<div class="mejs-button mejs-captions-button">' +
'<button type="button" aria-controls="' + t.id + '" title="' + t.options.tracksText + '" aria-label="' + t.options.tracksText + '"></button>' +
'<div class="mejs-captions-selector">' +
'<ul>' +
'<li>' +
'<input type="radio" name="' + player.id + '_captions" id="' + player.id + '_captions_none" value="none" checked="checked" />' +
'<label for="' + player.id + '_captions_none">' + mejs.i18n.t('None') + '</label>' +
'</li>' +
'</ul>' +
'</div>' +
'</div>')
.appendTo(controls);

Your environment

  • v5.37.1
  • chrome

Expected behaviour

On rebuild the control buttons should be kept in the order specified in _playerOptions

Actual behaviour

Closed caption button moved to the end of the controls

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions