-
-
Notifications
You must be signed in to change notification settings - Fork 706
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
Webtorrent 2 working in Chrome #1317
Conversation
emersion
commented
Sep 2, 2016
•
edited
Loading
edited
- Fix Chrome and Opera Memory related errors
- Check for support before using StreamSaver.js and fallback to WebTorrent.
You will want to add streamSaver to the blacklist for JS linting, or add a |
I don't see this working as intended in Chrome, WebTorrent continues as before, but steamSaver seems to try and load from a pop-up which gets blocked.
|
So jimmywarting/StreamSaver.js says (emphasis added):
This leads me to believe that this might work in Chrome and Opera over HTTPS. I have asked @btkostner to deploy a test so we can see more easily without everyone needing to set one up. |
It seems to be angry at cross domain for the beta site: http://beta.elementary.io/branch/origin/webtorrent/ |
What about the HTTPS version? https://beta.elementary.io/branch/origin/webtorrent/ |
Actually, you need to set a |
added, but the script expects a file ending in Filename: |
That script isn't adding the file, it's adding the torrent file, which is only on the |
I guess that would be why I can't access it then |
Looks like this does work fine over HTTPS, but not HTTP with StreamSaver. We just need to add this check and it can all be moved to |
The only thing I'd want is streamSaver ming to JSDelivr, but that can be done in |
Yea, popups... my most hated thing either way... The reason why a popup can be blocked is if it's not open durning a user interaction event... onclick will open the popup just fine. but doing But it don't seems like a problem to you if your production site is using https btw my next big release will reduce the nr of popups a site needs to open since it will use the same channel when it has been establish with the SW (it also removes the iframe when it has been establish, seems pointless but the iframe is not needed anymore) onclick = evt => {
streamSaver.setupChannel() // open the popup send a messageChannel to SW then close the popup
// then later you can call createWriteStream without seeing any more popups
setTimeout(()=>{ // or onTorrent event
streamSaver.createWriteStream(...)
}, 5000)
} Otherwise you need to do something like stream = streamSaver.createWriteStream('unknown filename')
onTorrent(torrent){
stream.write(...)
} Thanks for giving me this idea about making setupChannel available ;) |