mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-03-29 01:28:48 +00:00
request session on click chromecast button
This commit is contained in:
parent
dd8b30eff0
commit
2d9f46cbe7
1 changed files with 1 additions and 8 deletions
|
|
@ -70,14 +70,7 @@ const ControlBar = ({
|
|||
}
|
||||
}, [onToggleInfoMenu]);
|
||||
const onChromecastButtonClick = React.useCallback(() => {
|
||||
if (chromecast.active) {
|
||||
const sessionState = chromecast.transport.getSessionState();
|
||||
if (sessionState === cast.framework.SessionState.SESSION_STARTING || sessionState === cast.framework.SessionState.SESSION_STARTED) {
|
||||
chromecast.transport.dispatch({ type: 'endCurrentSession', stopCasting: true });
|
||||
} else {
|
||||
chromecast.transport.dispatch({ type: 'requestSession' });
|
||||
}
|
||||
}
|
||||
chromecast.transport.requestSession();
|
||||
}, []);
|
||||
React.useEffect(() => {
|
||||
const onStateChanged = () => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue