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 run the Next.js example, the following environment is required:
- Next.js version: 12.X or later
- React version: 17.X or later
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 server components. You can view how to make a client component in the official Next.js website. The official website clearly distinguishes when to use a server component 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 `
</>
)
}