useVideoPlayerPrefs()

useVideoPlayerPrefs reads and writes the two user preferences of SwVideoPlayer (framework#427):

PreferenceDefaultEffect
skipIntroOutrotrueSkip intro & credits: with skip set, the intro is skipped and entering the credits starts the next-episode countdown
autoPlayNexttrueAutoplay next episode: with show-play-next on, a 5-second countdown at the end / credits, then play-next is emitted

When show-play-next is on, the player already puts both toggles in the Artplayer settings panel, so you usually don't call this composable yourself — use it only to show the same toggles on your own settings page.

const { prefs, set } = useVideoPlayerPrefs()

prefs.value.autoPlayNext        // read (computed, always a complete object)
set({ skipIntroOutro: false })  // writes only the fields you pass
  • Stored via framework's encrypted useLocal (key sw-video-player-prefs, project prefix added automatically) — don't read or write localStorage yourself.
  • Missing fields in the stored object (older versions / manual edits) fall back to the defaults.
  • During SSR it returns the defaults; the user's real choice is available after hydration — read it in client-side interactions only.