mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-03-11 21:27:05 +00:00
22 lines
756 B
JavaScript
22 lines
756 B
JavaScript
// Copyright (C) 2017-2023 Smart code 203358507
|
|
|
|
const React = require('react');
|
|
const { withCoreSuspender, useStreamingServer } = require('stremio/common');
|
|
|
|
const DeepLinkHandler = () => {
|
|
const streamingServer = useStreamingServer();
|
|
React.useEffect(() => {
|
|
if (streamingServer.torrent !== null) {
|
|
const [, { type, content }] = streamingServer.torrent;
|
|
if (type === 'Ready') {
|
|
const [, deepLinks] = content;
|
|
if (typeof deepLinks.metaDetailsVideos === 'string') {
|
|
window.location = deepLinks.metaDetailsVideos;
|
|
}
|
|
}
|
|
}
|
|
}, [streamingServer.torrent]);
|
|
return null;
|
|
};
|
|
|
|
module.exports = withCoreSuspender(DeepLinkHandler);
|