Comments (4)
Here's something simple that should fix accidentally switching to twitch which most people are annoyed with I think. Only shows them the dialog if the event was caused by the twitch embed.
$(window).on('beforeunload', function(){
if (event.target.activeElement && $(event.target.activeElement).hasClass("twitch-element")){
return "You are being forwarded to the twitch.tv viewer.";
} else {
// Do stuff here if needed
}
});
from website.
I've tried that approach. There are two "small" issues that arise.
- Twitch stops the feed when you click (because it expects you to be navigated away) - the pause button doesn't go away.. and there is no way to start the stream.
- There is a bug because the redirect happens in the player, the message is invoked twice.
You are welcome to try implement, and if you can get it working do a push request.
from website.
I see, thats pretty lame. For restarting the stream, re-inserting the player into the parent seems to do the trick, bit hacky and has a 2-3 second delay before it starts playing again. I can't reproduce #2, it only asks me about the redirect once, and if I select "stay" then it stays.
Updated event snippet:
$(window).on('beforeunload', function(){
var player = event.target.activeElement;
if (player && $(player).hasClass("twitch-element")){
var playerParent = player.parentElement;
if (playerParent) {
$(player).detach();
$(playerParent).append(player);
return "You are being forwarded to the twitch.tv viewer.";
}
}
// Handle non twitch redirect
return;
});
from website.
nothing reasonable can be done
from website.
Related Issues (20)
- Schedule tab or something like a "next broadcast " text HOT 1
- Deployment Documentation HOT 4
- Hosting feature on homepage doesnt show the same streamer as on bigscreen HOT 1
- Unable to access API using authtoken (forbidden) HOT 1
- OAuth account email merging
- YouTube Membership Integration HOT 1
- Give Platform Subscribers Monthly Resub Messages
- Add Subscriber Counts To /admin/income
- alerts in /donate do not show if not logged in
- Do not allow users to delete all OAuth providers
- Allow YouTube embed to use /channel/live links HOT 1
- OperaGX Twitch Bigscreen problems HOT 1
- Allow oauth token to authenticate user in chat HOT 3
- Error Required field missing imageId
- DGG channel points HOT 1
- HTML special characters not correctly converted HOT 1
- [feature] push notifications for when the stream is live HOT 1
- Error: No authentication handler found. #2 HOT 2
- Update your database [with this script](https://github.com/destinygg/website/blob/master/scripts/db/upgrade-2.29.0-30-04-2021.sql) HOT 1
- Big emotes layer over text in chat
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from website.