- Print
- PDF
Create a player for Next.js
- Print
- PDF
Available in Classic and VPC
Applying a player for Next.js describes the example for applying and setting a player with Video Player Enhancement Web SDK JS.
To implement the Next.js example, the following environment is required:
- Next.js version: 13.2.4
- React Version: 18.2.0 (
react-dom
version: 18.2.0)
Understand features of Next.js
Make sure to consider the Next.js’ features before applying the Video Player Enhancement service.
In Next.js version 13, you should use "use client";
with a client component in the CSR manner since all components are subcomponents. You can view how to make a client component in the official Next.js website. The official website clearly distinguishes when to use a subcomponent from when to use a client component and guides you. See Rendering: Server and Client Components | Next.js.
You can use the features related to React after writing with a client component. When you enter 'use client'
in the first line of the Next.js file, the file is regarded as a client component.
Load a script using function
In Next.js, you can apply the player by creating a client component and loading an external script.
You can use the `
</>
)
}