Skip to content

onstatechange and onstateidle is not being fired #2318

@El-Vishy

Description

@El-Vishy

Have you read the FAQ and checked for duplicate open issues?
Yes

What version of Shaka Player are you using?
2.5.6 and 2.5.7

Can you reproduce the issue with our latest release version?
Yes

Can you reproduce the issue with the latest code from master?
Yes

Are you using the demo app or your own custom app?
Yes

If custom app, can you reproduce the issue using our demo app?
Yes

What browser and OS are you using?
Chrome 79.0.3945.88 and Mac OS 10.14.6

For embedded devices (smart TVs, etc.), what model and firmware version are you using?
NA

What are the manifest and license server URIs?

These dont require license.

What did you do?
I use shaka-player.ui.js, which creates shakaplayer instance. I use following code to access player instance and add listeners for "onstatechange" and "onstateidle" events.

      video = document.getElementById('video');
      const ui = video['ui'];
      const controls = ui.getControls();
      shakaPlayer = controls.getPlayer();
      shakaPlayer.addEventListener("onstatechange",onStateChanged);
      shakaPlayer.addEventListener("onstateidle",onStateIdle);

      function onStateChanged(event) {
          console.log("onStateChanged Event ", event.state);
     }

    function onStateIdle(event) {
          console.log("onStateIdle Event ", event.state);
    }

What did you expect to happen?
I expected onStateChanged() and onStateIdle() methods to be called, with different events like

  • onStateChanged Event attach
  • onStateChanged Event media-source
  • onStateIdle Event media-source
  • onStateChanged Event manifest-parser
  • onStateChanged Event manifest
  • onStateChanged Event drm-engine
  • onStateChanged Event load
  • onStateIdle Event load
  • onStateChanged Event unload
  • onStateChanged Event detach

What actually happened?
If I use shaka-player.ui.js and add listener for "onstatechange" and "onstateidle" events. The callback methods are not called.

But if I manually create an instance shaka player and add listeners for "onstatechange" and "onstateidle" events, they seem to work.

SamplePlayers.zip
This has two players

  • shakaplayerBug.html -> Event is not fired
  • shakaplayerWorking.html -> Event is fired

I have also hosted the player to following location:

Metadata

Metadata

Assignees

Labels

status: archivedArchived and locked; will not be updatedtype: bugSomething isn't working correctly

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions