deserialize stream with pako and atob

This commit is contained in:
nklhrstv 2020-03-19 11:31:33 +02:00
parent a4308fd594
commit b6fd5d9a46

View file

@ -1,4 +1,5 @@
const React = require('react');
const pako = require('pako');
const { useModelState } = require('stremio/common');
const initPlayerState = () => ({
@ -75,7 +76,7 @@ const usePlayer = (urlParams) => {
args: {
model: 'Player',
args: {
stream: JSON.parse(urlParams.stream),
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' ?
{
base: urlParams.transportUrl,