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

Slowing down the network calls #130

Open
KVPasupuleti opened this issue Jun 18, 2022 · 2 comments
Open

Slowing down the network calls #130

KVPasupuleti opened this issue Jun 18, 2022 · 2 comments
Labels

Comments

@KVPasupuleti
Copy link

Hey @jpillora,

Appreciate your effort and the package is awesome.

I have a use case for implementing Token-based authentication for our videos that we support using video.js. And, we tried implementing that using xhook to support iOS Chrome.

But, the segments/chunks are delayed to download; hence, the video doesn't appear to be smooth and stays stagnant until the next segment gets downloaded.

Can we kick that up and make any better?

@KVPasupuleti
Copy link
Author

KVPasupuleti commented Jun 27, 2022

The reason for the segments/chunks to be delayed is this file called vendors~main.chunk.js.

This is getting downloaded each time I replace my request URL like this

xhook.before(function(request: any) {
   const videoToken = localStorage.getItem('videoToken')
   if (!request.url.includes('token') && videoToken) {
      const newRequestUrl = `${request.url}?token=${videoToken}`
      request.url = newRequestUrl
   }
})

Previously, we identified this issue when we mistakenly assigned an undefined value to an onHover event listener in our Create React App.

I have checked the xhook.coffee file, and logged everywhere there is an ON, but couldn't find anything with the above behavior.

Is there something in this code that is causing this issue?

Note: This is happening only in my development server, but not in my production build

Please help me out with this.

@jpillora
Copy link
Owner

I'd suggest pulling the latest code on the main branch and attempting to debug this with the new source code (https://github.com/jpillora/xhook/releases/tag/v1.5.1)

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

No branches or pull requests

2 participants