Skip to content

Commit

Permalink
Work around lack of error event type info in demo
Browse files Browse the repository at this point in the history
The demo listens for shaka.Player.ErrorEvent, but it doesn't have type
information for that type.  This is because the type is defined only
in the docs, and not in the externs.  There is no actual class defined
for the event types.

The extern generator should be improved to handle this, but in the
meantime, we will use square brackets.

This was caught by a compiler upgrade.

Issue shaka-project#2528

Change-Id: I55fc5fcc7f391f3155c1edc712064c5091fa363e
  • Loading branch information
joeyparrish committed Apr 29, 2020
1 parent 07335d7 commit 53242f9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion demo/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -1584,7 +1584,9 @@ shakaDemo.Main = class {
* @private
*/
onErrorEvent_(event) {
this.onError_(event.detail);
// TODO: generate externs automatically from @event types
// This event should be shaka.Player.ErrorEvent
this.onError_(event['detail']);
}

/**
Expand Down

0 comments on commit 53242f9

Please sign in to comment.