Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot read properties of null (reading 'abort') #327

Open
jaynguyen2309 opened this issue May 24, 2024 · 1 comment
Open

Cannot read properties of null (reading 'abort') #327

jaynguyen2309 opened this issue May 24, 2024 · 1 comment

Comments

@jaynguyen2309
Copy link

jaynguyen2309 commented May 24, 2024

Describe the bug
I have setup the jsmpeg-player library to stream a video source from websocket. I did exactly the same as the demo showed in jsmpeg-player-demo, but it came up with this error

JsmpegPlayer.tsx

Live stream page

`
/* eslint-disable @typescript-eslint/no-explicit-any */
import React from 'react';
import { AppPageContainer } from '../components/layout/AppPageContainer';
import { PageContent } from '../sharedComponents/layout/PageContent';
import JsmpegPlayer from './liveStreamPage/JsmpegPlayer';

const videoOptions = {
poster: 'https://cycjimmy.github.io/staticFiles/images/screenshot/big_buck_bunny_640x360.jpg',
};

const videoOverlayOptions = {};

const LiveStreamPage = () => {
let jsmpegPlayer: any = null;

return (
    <div>
        <AppPageContainer title="Live stream">
            <PageContent title="Live stream page">
                <JsmpegPlayer
                    wrapperClassName="video-wrapper"
                    videoUrl="https://cycjimmy.github.io/staticFiles/media/big_buck_bunny_640x360.ts"
                    options={videoOptions}
                    overlayOptions={videoOverlayOptions}
                    onRef={(ref) => (jsmpegPlayer = ref)}
                />
                <div className="buttons-wrapper">
                    <button onClick={() => jsmpegPlayer.play()}>Play</button>
                    <button onClick={() => jsmpegPlayer.pause()}>Pause</button>
                    <button onClick={() => jsmpegPlayer.stop()}>Stop</button>
                </div>
            </PageContent>
        </AppPageContainer>
    </div>
);

};

export default LiveStreamPage;
`

  • Device: Laptop
  • OS: MacOS Sonoma 14.5
  • Browser Chrome
@lszhn
Copy link

lszhn commented Oct 10, 2024

Any update? same issue under React Strict Mode

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants