This repository has been archived by the owner on May 24, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9848fda
commit c24a817
Showing
20 changed files
with
1,446 additions
and
519 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
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 |
---|---|---|
@@ -0,0 +1,53 @@ | ||
--- | ||
layout: page | ||
title: Live | ||
navigation: 6 | ||
--- | ||
|
||
# Live Mode | ||
|
||
<p id="example"></p> | ||
<script src="{{ 'embed.js' | relative_url }}"></script> | ||
<script> | ||
podlovePlayer('#example', { | ||
mode: 'live', | ||
title: 'Livestream', | ||
subtitle: 'Wir sind ein CreativeCommons-Webradio, das sich zur Aufgabe gemacht hat freie Musik zu verbreiten und die Hörer durch die vielen Beteiligungsmöglichkeiten direkt zu einem Teil unserer Sendungen zu machen.', | ||
link: 'https://theradio.cc', | ||
poster: 'https://theradio.cc/wp-content/uploads/2014/01/9e7d1d68285200b9d3c0-150x150.jpg', | ||
show: { | ||
title: 'TheRadio.cc', | ||
link: 'https://theradio.cc' | ||
}, | ||
audio: [{ | ||
url: 'http://mp3.theradio.cc/', | ||
mimeType: 'audio/mp3' | ||
}, { | ||
url: 'http://ogg.theradio.cc/', | ||
mimeType: 'audio/ogg' | ||
}] | ||
}); | ||
</script> | ||
|
||
## Config | ||
|
||
```javascript | ||
{ | ||
mode: 'live', | ||
title: 'Livestream', | ||
subtitle: 'Wir sind ein CreativeCommons-Webradio, das sich zur Aufgabe gemacht hat freie Musik zu verbreiten und die Hörer durch die vielen Beteiligungsmöglichkeiten direkt zu einem Teil unserer Sendungen zu machen.', | ||
link: 'https://theradio.cc', | ||
poster: 'https://theradio.cc/wp-content/uploads/2014/01/9e7d1d68285200b9d3c0-150x150.jpg', | ||
show: { | ||
title: 'TheRadio.cc', | ||
link: 'https://theradio.cc' | ||
}, | ||
audio: [{ | ||
url: 'http://mp3.theradio.cc/', | ||
mimeType: 'audio/mp3' | ||
}, { | ||
url: 'http://ogg.theradio.cc/', | ||
mimeType: 'audio/ogg' | ||
}] | ||
} | ||
``` |
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 was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
import { get } from 'lodash' | ||
import actions from '../actions' | ||
|
||
const hasChapters = chapters => chapters.length > 0 | ||
const hasMeta = (show, episode) => episode.poster || show.poster || show.title || episode.title || episode.subtitle | ||
const hasFiles = files => files.length > 0 | ||
|
||
export default (store, action) => { | ||
switch (action.type) { | ||
case 'LOADING': | ||
store.dispatch(actions.showLoadingButton()) | ||
break | ||
case 'LOADED': | ||
if (action.payload.paused) { | ||
store.dispatch(actions.showPauseButton()) | ||
} else { | ||
store.dispatch(actions.showPlayingButton()) | ||
} | ||
break | ||
case 'PLAY': | ||
// Default behaviour | ||
store.dispatch(actions.showPlayingButton()) | ||
store.dispatch(actions.toggleProgressBar(true)) | ||
store.dispatch(actions.toggleChapterControls(true)) | ||
store.dispatch(actions.toggleSteppersControls(true)) | ||
|
||
// Error Fallbacks | ||
store.dispatch(actions.toggleInfo(true)) | ||
store.dispatch(actions.toggleError(false)) | ||
break | ||
case 'PAUSE': | ||
store.dispatch(actions.showPauseButton()) | ||
break | ||
case 'IDLE': | ||
store.dispatch(actions.showPauseButton()) | ||
store.dispatch(actions.toggleChapterControls(true)) | ||
store.dispatch(actions.toggleSteppersControls(true)) | ||
store.dispatch(actions.toggleProgressBar(true)) | ||
break | ||
case 'INIT': | ||
const state = store.getState() | ||
const chapters = get(state, 'chapters', []) | ||
const downloadFiles = get(state, 'download.files', []) | ||
const episode = get(state, 'episode', {}) | ||
const show = get(state, 'show', {}) | ||
const runtime = get(state, 'runtime', {}) | ||
|
||
// Tabs | ||
if (hasChapters(chapters)) { | ||
store.dispatch(actions.toggleComponentTab('chapters', true)) | ||
} | ||
|
||
if (hasFiles(downloadFiles)) { | ||
store.dispatch(actions.toggleComponentTab('download', true)) | ||
} | ||
|
||
// Meta | ||
if (hasMeta(show, episode)) { | ||
store.dispatch(actions.toggleInfo(true)) | ||
} | ||
|
||
// Audio Modifiers | ||
if (runtime.platform === 'desktop') { | ||
store.dispatch(actions.toggleVolumeSlider(true)) | ||
} | ||
|
||
// Everything else without conditions | ||
store.dispatch(actions.toggleComponentTab('share', true)) | ||
store.dispatch(actions.toggleComponentTab('info', true)) | ||
store.dispatch(actions.toggleComponentTab('audio', true)) | ||
store.dispatch(actions.toggleRateSlider(true)) | ||
store.dispatch(actions.toggleInfoPoster(true)) | ||
break | ||
case 'END': | ||
store.dispatch(actions.showReplayButton()) | ||
break | ||
case 'ERROR_LOAD': | ||
store.dispatch(actions.toggleInfo(false)) | ||
store.dispatch(actions.toggleError(true)) | ||
store.dispatch(actions.showRetryButton()) | ||
store.dispatch(actions.toggleProgressBar(false)) | ||
store.dispatch(actions.toggleChapterControls(false)) | ||
store.dispatch(actions.toggleSteppersControls(false)) | ||
break | ||
case 'ERROR_MISSING_AUDIO_FILES': | ||
store.dispatch(actions.toggleInfo(false)) | ||
store.dispatch(actions.toggleError(true)) | ||
store.dispatch(actions.toggleButtonControl(false)) | ||
store.dispatch(actions.toggleProgressBar(false)) | ||
store.dispatch(actions.toggleChapterControls(false)) | ||
store.dispatch(actions.toggleSteppersControls(false)) | ||
break | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
src/store/effects/components.test.js → src/store/effects/components.episode.test.js
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,95 +1,12 @@ | ||
import { get } from 'lodash' | ||
import actions from '../actions' | ||
|
||
const hasChapters = chapters => chapters.length > 0 | ||
const hasMeta = (show, episode) => episode.poster || show.poster || show.title || episode.title || episode.subtitle | ||
const hasFiles = files => files.length > 0 | ||
import episodeComponents from './components.episode' | ||
import liveComponents from './components.live' | ||
|
||
export default (store, action) => { | ||
switch (action.type) { | ||
case 'LOADING': | ||
store.dispatch(actions.showLoadingButton()) | ||
break | ||
case 'LOADED': | ||
if (action.payload.paused) { | ||
store.dispatch(actions.showPauseButton()) | ||
} else { | ||
store.dispatch(actions.showPlayingButton()) | ||
} | ||
break | ||
case 'PLAY': | ||
// Default behaviour | ||
store.dispatch(actions.showPlayingButton()) | ||
store.dispatch(actions.toggleProgressBar(true)) | ||
store.dispatch(actions.toggleChapterControls(true)) | ||
store.dispatch(actions.toggleSteppersControls(true)) | ||
|
||
// Error Fallbacks | ||
store.dispatch(actions.toggleInfo(true)) | ||
store.dispatch(actions.toggleError(false)) | ||
break | ||
case 'PAUSE': | ||
store.dispatch(actions.showPauseButton()) | ||
break | ||
case 'IDLE': | ||
store.dispatch(actions.showPauseButton()) | ||
store.dispatch(actions.toggleChapterControls(true)) | ||
store.dispatch(actions.toggleSteppersControls(true)) | ||
store.dispatch(actions.toggleProgressBar(true)) | ||
break | ||
case 'INIT': | ||
const state = store.getState() | ||
const chapters = get(state, 'chapters', []) | ||
const downloadFiles = get(state, 'download.files', []) | ||
const episode = get(state, 'episode', {}) | ||
const show = get(state, 'show', {}) | ||
const runtime = get(state, 'runtime', {}) | ||
|
||
// Tabs | ||
if (hasChapters(chapters)) { | ||
store.dispatch(actions.toggleComponentTab('chapters', true)) | ||
} | ||
|
||
if (hasFiles(downloadFiles)) { | ||
store.dispatch(actions.toggleComponentTab('download', true)) | ||
} | ||
|
||
// Meta | ||
if (hasMeta(show, episode)) { | ||
store.dispatch(actions.toggleInfo(true)) | ||
} | ||
|
||
// Audio Modifiers | ||
if (runtime.platform === 'desktop') { | ||
store.dispatch(actions.toggleVolumeSlider(true)) | ||
} | ||
const state = store.getState() | ||
|
||
// Everything else without conditions | ||
store.dispatch(actions.toggleComponentTab('share', true)) | ||
store.dispatch(actions.toggleComponentTab('info', true)) | ||
store.dispatch(actions.toggleComponentTab('audio', true)) | ||
store.dispatch(actions.toggleRateSlider(true)) | ||
store.dispatch(actions.toggleRateSlider(true)) | ||
store.dispatch(actions.toggleInfoPoster(true)) | ||
break | ||
case 'END': | ||
store.dispatch(actions.showReplayButton()) | ||
break | ||
case 'ERROR_LOAD': | ||
store.dispatch(actions.toggleInfo(false)) | ||
store.dispatch(actions.toggleError(true)) | ||
store.dispatch(actions.showRetryButton()) | ||
store.dispatch(actions.toggleProgressBar(false)) | ||
store.dispatch(actions.toggleChapterControls(false)) | ||
store.dispatch(actions.toggleSteppersControls(false)) | ||
break | ||
case 'ERROR_MISSING_AUDIO_FILES': | ||
store.dispatch(actions.toggleInfo(false)) | ||
store.dispatch(actions.toggleError(true)) | ||
store.dispatch(actions.toggleButtonControl(false)) | ||
store.dispatch(actions.toggleProgressBar(false)) | ||
store.dispatch(actions.toggleChapterControls(false)) | ||
store.dispatch(actions.toggleSteppersControls(false)) | ||
break | ||
if (state.mode === 'live') { | ||
liveComponents(store, action) | ||
} else { | ||
episodeComponents(store, action) | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import { get } from 'lodash' | ||
import actions from '../actions' | ||
|
||
const hasMeta = (show, episode) => episode.poster || show.poster || show.title || episode.title || episode.subtitle | ||
|
||
export default (store, action) => { | ||
switch (action.type) { | ||
case 'LOADING': | ||
store.dispatch(actions.showLoadingButton()) | ||
break | ||
case 'LOADED': | ||
if (action.payload.paused) { | ||
store.dispatch(actions.showPauseButton()) | ||
} else { | ||
store.dispatch(actions.showPlayingButton()) | ||
} | ||
break | ||
case 'PLAY': | ||
// Default behaviour | ||
store.dispatch(actions.showPlayingButton()) | ||
|
||
// Error Fallbacks | ||
store.dispatch(actions.toggleInfo(true)) | ||
store.dispatch(actions.toggleError(false)) | ||
break | ||
case 'PAUSE': | ||
store.dispatch(actions.showPauseButton()) | ||
break | ||
case 'IDLE': | ||
store.dispatch(actions.showPauseButton()) | ||
store.dispatch(actions.toggleChapterControls(true)) | ||
store.dispatch(actions.toggleSteppersControls(true)) | ||
store.dispatch(actions.toggleProgressBar(true)) | ||
break | ||
case 'INIT': | ||
const state = store.getState() | ||
const episode = get(state, 'episode', {}) | ||
const show = get(state, 'show', {}) | ||
const runtime = get(state, 'runtime', {}) | ||
|
||
// Meta | ||
if (hasMeta(show, episode)) { | ||
store.dispatch(actions.toggleInfo(true)) | ||
} | ||
|
||
// Audio Modifiers | ||
if (runtime.platform === 'desktop') { | ||
store.dispatch(actions.toggleVolumeSlider(true)) | ||
} | ||
|
||
// Everything else without conditions | ||
store.dispatch(actions.toggleComponentTab('info', true)) | ||
store.dispatch(actions.toggleComponentTab('audio', true)) | ||
store.dispatch(actions.toggleInfoPoster(true)) | ||
store.dispatch(actions.showPauseButton()) | ||
break | ||
case 'ERROR_LOAD': | ||
store.dispatch(actions.toggleInfo(false)) | ||
store.dispatch(actions.toggleError(true)) | ||
store.dispatch(actions.showRetryButton()) | ||
break | ||
case 'ERROR_MISSING_AUDIO_FILES': | ||
store.dispatch(actions.toggleInfo(false)) | ||
store.dispatch(actions.toggleError(true)) | ||
store.dispatch(actions.toggleButtonControl(false)) | ||
break | ||
} | ||
} |
Oops, something went wrong.