Skip to content

Commit

Permalink
Correct Factory-Constructor Syntax
Browse files Browse the repository at this point in the history
Right now because the text displayer factory must be a constructor
and () => {} can't be a constructor, we need to change function-syntax
used in ui/ui.js.

Change-Id: Ib87b9353c5a955a3556949ed754314b1bee16dad
  • Loading branch information
vaage committed Feb 21, 2019
1 parent 96d1509 commit df39269
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ui/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,12 @@ shaka.ui.Overlay.createUI_ = function(container, video, config) {
const player = new shaka.Player(video);
const ui = new shaka.ui.Overlay(player, container, video, config);

// If the browser's native controls are disabled, use UI TextDisplayer.
// If the browser's native controls are disabled, use UI TextDisplayer. Right
// now because the factory must be a constructor and () => {} can't be a
// constructor.
if (!video.controls) {
player.configure('textDisplayFactory',
player.configure(
'textDisplayFactory',
function() { return new shaka.ui.TextDisplayer(video, container); });
}

Expand Down

0 comments on commit df39269

Please sign in to comment.