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

plyr not work in nextjs13 #2757

Open
xiayutian3 opened this issue Dec 13, 2023 · 0 comments
Open

plyr not work in nextjs13 #2757

xiayutian3 opened this issue Dec 13, 2023 · 0 comments

Comments

@xiayutian3
Copy link

i use plyr@3.7.8 in nextjs13.4, the player not work,but the same code in reactjs,it work, why?
here is the code

`"use client"
import React, { useRef, useEffect } from 'react';
import Plyr from 'plyr';
import "plyr/dist/plyr.css";
const Player = ({ videoSrc, videoType }) => {
const videoRef = useRef();

  useEffect(() => {
    if(!videoRef.current) return;

    const playerInstance = new Plyr(videoRef.current);

    return () => {
      playerInstance.destroy();
    }
  }, []);

  return (
    <video ref={videoRef} controls playsInline>
      {/* <source src={videoSrc} type={videoType || 'video/mp4'} /> */}
    </video>
  );
}

export default Player;`

Expected behaviour

1

Actual behaviour

2

Steps to reproduce

Environment

  • Browser: Chrome
  • Version: 119
  • Operating System: windows
  • Version: 11

Additional context

Project Info:
Next.JS: 13.4
Plyr: 3.7.8

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

1 participant