af9ce32d by Adam Heath

When installing the player.hls deprecation accessor, use options.tag,

not options.playerId.

This fixes the case where the DOM element has been created, the player
has been initialized, but has not yet been attached to the document.  In
this scenario, the string id is passed to the videojs constructor, and
it is not able to do a getElementById call correctly.

This can happen when the new html(with an embedded <video>) has been
created, but the new DOM structure is having a fancy style transition,
where the old DOM is attached, the new DOM is not, but the height on the
new/old is needed, and a fancy slide up/down is being done between the 2
heights.
1 parent c5991ff3
......@@ -282,8 +282,8 @@ class HlsHandler extends Component {
// tech.player() is deprecated but setup a reference to HLS for
// backwards-compatibility
if (tech.options_ && tech.options_.playerId) {
let _player = videojs(tech.options_.playerId);
if (tech.options_ && tech.options_.tag) {
let _player = videojs(tech.options_.tag);
if (!_player.hasOwnProperty('hls')) {
Object.defineProperty(_player, 'hls', {
......