Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

event.data.indexOf is not a function #17

Open
selected-pixel-jameson opened this issue Apr 19, 2022 · 1 comment
Open

event.data.indexOf is not a function #17

selected-pixel-jameson opened this issue Apr 19, 2022 · 1 comment

Comments

@selected-pixel-jameson
Copy link

selected-pixel-jameson commented Apr 19, 2022

I'm creating a TimingObject instance like so:

 this.timingObject = new TIMINGSRC.TimingObject({ range: [0, 360] });
 await this.timingObject.ready
 
  this.videos.forEach((video, index) => {
    console.log('VIDEO SRC', video.src)
    if (!video.src.includes('#')) {
      this.syncs.push(MCorp.mediaSync(video, this.timingObject));
      if (index !== 0) {
        this.syncs[index].setSkew(0.09);
      }
    }
  })

However, when I play the timingObject.

this.timingObject.update({ velocity: 1.0 });

It throws this error, but the videos do play. I'm just not sure what side affects this error could be causing.

ERROR TypeError: event.data.indexOf is not a function
at Timeout.handleEvent (timingsrc-v2.js:1633:55)
at task.callback (zone.js:1596:1)
at ZoneDelegate.invokeTask (zone.js:406:1)
at Object.onInvokeTask (core.mjs:25505:1)
at ZoneDelegate.invokeTask (zone.js:405:1)
at Zone.runTask (zone.js:178:1)
at ZoneTask.invokeTask [as invoke] (zone.js:487:1)
at invokeTask (zone.js:1600:1)
at globalZoneAwareCaptureCallback (zone.js:1658:1)

Which is referencing this block of code.

```
Timeout.prototype.handleEvent = function (event) {
        if (event.source === window && event.data.indexOf("smalldelaymsg_") === 0) {
            event.stopPropagation();
            // ignore if timeout has been canceled
            var the_tid = parseInt(event.data.split("_")[1]);
            if (this._tid !== null && this._tid === the_tid) {
                this._ontimeout();
            }
        }
    };

Any help or direction in solving this would be really appreciated. 

Thank you.
@ingararntzen
Copy link
Contributor

Hi. V2 is about to be deprecated. This should likely not be an issue with v3 though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants