-
-
Notifications
You must be signed in to change notification settings - Fork 208
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
8424494
commit 7179965
Showing
3 changed files
with
50 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -88,6 +88,9 @@ npm install react-jinke-music-player --save | |
- [x] Support typescript (d.ts) | ||
- [x] Support lyric | ||
- [x] Play list | ||
- [x] Full player features | ||
- [x] [Server-Side Rendering](#bulb-server-side-rendering) | ||
- [x] [Import in Browser](#bulb-import-in-browser) | ||
- [x] [Complete hook function](#clipboard-api) | ||
- [x] [Custom operation ui](#bulb-custom-operation-ui) | ||
- [x] [Custom downloader](#bulb-custom-downloader) | ||
|
@@ -534,6 +537,49 @@ export interface ReactJkMusicPlayerIcon { | |
*/ | ||
``` | ||
|
||
## :bulb: Import in browser | ||
|
||
```html | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<link | ||
rel="stylesheet" | ||
href="https://unpkg.com/[email protected]/assets/index.css" | ||
/> | ||
</head> | ||
<body> | ||
<div id="root"></div> | ||
</body> | ||
<script src="https://unpkg.com/[email protected]/umd/react.production.min.js"></script> | ||
<script src="https://unpkg.com/[email protected]/umd/react-dom.production.min.js"></script> | ||
<script src="https://unpkg.com/[email protected]/dist/react-jinke-music-player.min.js"></script> | ||
<script> | ||
ReactDOM.render( | ||
React.createElement(ReactJkMusicPlayer), | ||
document.getElementById('root'), | ||
) | ||
</script> | ||
</html> | ||
``` | ||
|
||
## :bulb: Server-Side Rendering | ||
|
||
```jsx | ||
// components/Player.js | ||
import React from 'react' | ||
import ReactJkMusicPlayer from 'react-jinke-music-player' | ||
import styles from 'react-jinke-music-player/assets/index.module.css' | ||
export const Player = () => <ReactJkMusicPlayer /> | ||
// pages/_app.js | ||
import dynamic from 'next/dynamic' | ||
const PlayerWithNoSSR = dynamic(() => import('../components/Player'), { | ||
ssr: false, | ||
}) | ||
``` | ||
|
||
## :pencil: Development | ||
|
||
```bash | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters