mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-04-20 06:32:11 +00:00
player route adapted to changes in core
This commit is contained in:
parent
b6fd5d9a46
commit
ed76d68363
2 changed files with 16 additions and 3 deletions
|
|
@ -342,7 +342,8 @@ const Player = ({ urlParams }) => {
|
|||
Player.propTypes = {
|
||||
urlParams: PropTypes.exact({
|
||||
stream: PropTypes.string,
|
||||
transportUrl: PropTypes.string,
|
||||
streamTransportUrl: PropTypes.string,
|
||||
metaTransportUrl: PropTypes.string,
|
||||
type: PropTypes.string,
|
||||
id: PropTypes.string,
|
||||
videoId: PropTypes.string
|
||||
|
|
|
|||
|
|
@ -77,9 +77,21 @@ const usePlayer = (urlParams) => {
|
|||
model: 'Player',
|
||||
args: {
|
||||
stream: JSON.parse(pako.inflate(atob(urlParams.stream), { to: 'string' })),
|
||||
meta_resource_request: typeof urlParams.transportUrl === 'string' && typeof urlParams.type === 'string' && typeof urlParams.id === 'string' ?
|
||||
stream_resource_request: typeof urlParams.streamTransportUrl === 'string' && typeof urlParams.type === 'string' && typeof urlParams.videoId === 'string' ?
|
||||
{
|
||||
base: urlParams.transportUrl,
|
||||
base: urlParams.streamTransportUrl,
|
||||
path: {
|
||||
resource: 'stream',
|
||||
type_name: urlParams.type,
|
||||
id: urlParams.videoId,
|
||||
extra: []
|
||||
}
|
||||
}
|
||||
:
|
||||
null,
|
||||
meta_resource_request: typeof urlParams.metaTransportUrl === 'string' && typeof urlParams.type === 'string' && typeof urlParams.id === 'string' ?
|
||||
{
|
||||
base: urlParams.metaTransportUrl,
|
||||
path: {
|
||||
resource: 'meta',
|
||||
type_name: urlParams.type,
|
||||
|
|
|
|||
Loading…
Reference in a new issue