@podlove/player-sagas

6.0.1-alpha.7 • Public • Published

Player Sagas

Isolated side effects for the player lifecycle based on redux-saga

Available Sagas

Lifecycle

Parses provided configuration and emits the READY event.

import sagas from '@podlove/player-sagas'
import lifecycleSaga from '@podlove/player-sagas/lifecycle'

sagas.run(
  lifecycleSaga
)

Runtime

Parses the player runtime (browser, client, ...) and emits SET_RUNTIME.

import sagas from '@podlove/player-sagas'
import runtimeSaga from '@podlove/player-sagas/runtime'

sagas.run(
  runtimeSaga
)

Player

Connects the media actions (start, stop, scrub, ...) to the html5 audio/video api.

import sagas from '@podlove/player-sagas'
import playerSaga from '@podlove/player-sagas/player'

sagas.run(
  playerSaga({ selectMedia: selectors.media, selectPlaytime: selectors.playtime })
)

Components

Shows/Hides components depending on the player state.

import sagas from '@podlove/player-sagas'
import componentsSaga from '@podlove/player-sagas/components'

sagas.run(
  componentsSaga
)

Chapters

Applies needed side effects when interacting with playtime/chapters.

import sagas from '@podlove/player-sagas'
import chaptersSaga from '@podlove/player-sagas/chapters'

sagas.run(
  chaptersSaga({
    selectDuration: selectors.duration,
    selectPlaytime: selectors.playtime,
    selectCurrentChapter: selectors.chapters.current,
    selectChapterList: selectors.chapters.list
  })
)

Quantiles

Creates quantiles for already listened sections.

import sagas from '@podlove/player-sagas'
import quantilesSaga from '@podlove/player-sagas/quantiles'

sagas.run(
  quantilesSaga
)

Version

Reads the Player Version and dispatches it to the store.

import sagas from '@podlove/player-sagas'
import versionSaga from '@podlove/player-sagas/version'

sagas.run(
  versionSaga({ version })
)

Transcripts

Applies needed side effects when interacting with playtime/transcripts.

import sagas from '@podlove/player-sagas'
import transcriptsSaga from '@podlove/player-sagas/transcripts'

sagas.run(
  transcriptsSaga({ selectChapters: selectors.chapters.list, selectSpeakers: selectors.contributors })
)

Readme

Keywords

none

Package Sidebar

Install

npm i @podlove/player-sagas

Weekly Downloads

8

Version

6.0.1-alpha.7

License

MIT

Unpacked Size

695 kB

Total Files

88

Last publish

Collaborators

  • minus0
  • alexander-heimbuch