Skip to content

Commit

Permalink
chore: doc
Browse files Browse the repository at this point in the history
  • Loading branch information
shiyiya authored Sep 20, 2024
1 parent ae6ea2c commit deea4d2
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 130 deletions.
2 changes: 1 addition & 1 deletion packages/docs/next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const withNextra = nextra({

export default withNextra({
output: 'export',
reactStrictMode: true,
reactStrictMode: false,
trailingSlash: true,
images: {
unoptimized: true
Expand Down
3 changes: 2 additions & 1 deletion packages/docs/src/pages/docs/_meta.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"index": "Introduction",
"guide": "Guide",
"start": "Install",
"player-configuration": "Configuration",

"-- Plugins": {
"type": "separator",
Expand Down
5 changes: 0 additions & 5 deletions packages/docs/src/pages/docs/guide/_meta.json

This file was deleted.

122 changes: 0 additions & 122 deletions packages/docs/src/pages/docs/guide/advanced.mdx

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Callout } from 'nextra-theme-docs'

<Callout>
`@oplayer/core` does not provide any ui related functions such as thumbnail, subtitles, etc. If
you need these functions please install `@oplayer/ui`
you need these functions please install `[@oplayer/ui](./ui)`
</Callout>

```js
Expand Down Expand Up @@ -62,3 +62,27 @@ export interface PlayerOptions {
isNativeUI?: () => boolean
}
```

## persisted state

```js
player.on('ratechange', () => {
if (!player.isSourceChanging)
localStorage.setItem('@oplayer/UserPreferences/speed', player.playbackRate.toString())
})

player.on('volumechange', () => {
localStorage.setItem('@oplayer/UserPreferences/volume', player.volume.toString())
})

player.on('timeupdate', () => {
localStorage.setItem(player.options.source.src, player.currentTime.toString())
})

player.on('loadedmetadata', () => {
var prevTime = localStorage.getItem(e.payload.src)
if (prevTime) {
player.seek(prevTime - 3)
}
})
```
File renamed without changes.

0 comments on commit deea4d2

Please sign in to comment.