mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-04-20 02:22:09 +00:00
refactor(OptionsMenu): use download prop from external deeplinks for streamUrl
This commit is contained in:
parent
825102bb0f
commit
117dd30c76
1 changed files with 5 additions and 9 deletions
|
|
@ -14,16 +14,12 @@ const OptionsMenu = ({ className, stream }) => {
|
|||
const toast = useToast();
|
||||
const streamUrl = React.useMemo(() => {
|
||||
return stream !== null ?
|
||||
typeof stream.url === 'string' ?
|
||||
stream.url
|
||||
stream.deepLinks &&
|
||||
stream.deepLinks.externalPlayer &&
|
||||
typeof stream.deepLinks.externalPlayer.download === 'string' ?
|
||||
stream.deepLinks.externalPlayer.download
|
||||
:
|
||||
typeof stream.infoHash === 'string' &&
|
||||
typeof stream.fileIdx === 'number' &&
|
||||
typeof streamingServer.selected === 'object' &&
|
||||
typeof streamingServer.selected.transportUrl === 'string' ?
|
||||
`${streamingServer.selected.transportUrl}${stream.infoHash}/${stream.fileIdx}`
|
||||
:
|
||||
null
|
||||
null
|
||||
:
|
||||
null;
|
||||
}, [stream, streamingServer]);
|
||||
|
|
|
|||
Loading…
Reference in a new issue