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.
Merge pull request #346 from alexander-heimbuch/feature/persist-playtime
Feature/persist playtime
- Loading branch information
Showing
27 changed files
with
170 additions
and
120 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
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 |
---|---|---|
|
@@ -45,7 +45,7 @@ | |
@import 'font'; | ||
@import 'share'; | ||
@import 'marquee'; | ||
@import 'utils'; | ||
.podlove { | ||
display: block; | ||
|
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
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
src/components/tabs/chapters/Entry.vue → ...components/tabs/chapters/ChapterEntry.vue
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
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Empty file.
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
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,22 @@ | ||
import actions from '../actions' | ||
|
||
let idle = null | ||
const IDLE_TIMEOUT = 10 * 60 * 1000 | ||
|
||
export default (store, action) => { | ||
switch (action.type) { | ||
case 'INIT': | ||
if (action.payload.playtime > 0) { | ||
store.dispatch(actions.idle()) | ||
} | ||
break | ||
case 'PLAY': | ||
clearTimeout(idle) | ||
break | ||
case 'PAUSE': | ||
idle = setTimeout(() => { | ||
store.dispatch(actions.idle()) | ||
}, IDLE_TIMEOUT) | ||
break | ||
} | ||
} |
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,11 @@ | ||
import mediaEffects from './media' | ||
import idleEffects from './idle' | ||
import storageEffects from './storage' | ||
|
||
export default store => next => action => { | ||
mediaEffects(store, action) | ||
storageEffects(store, action) | ||
idleEffects(store, action) | ||
|
||
return next(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,39 @@ | ||
import mediaPlayer from '../../media-player' | ||
import actions from '../actions' | ||
|
||
const initMediaPlayer = (dispatch, config) => | ||
mediaPlayer(config.audio, { | ||
setPlaytime: playtime => dispatch(actions.setPlaytime(playtime)), | ||
setBufferState: buffer => dispatch(actions.setBuffer(buffer)), | ||
setDuration: duration => dispatch(actions.setDuration(duration)), | ||
onPlay: () => dispatch(actions.playEvent()), | ||
onPause: () => dispatch(actions.pauseEvent()), | ||
onStop: () => dispatch(actions.stopEvent()), | ||
onLoad: () => dispatch(actions.loading()) | ||
}) | ||
|
||
let mediaElement | ||
|
||
export default (store, action) => { | ||
const state = store.getState() | ||
|
||
switch (action.type) { | ||
case 'INIT': | ||
mediaElement = initMediaPlayer(store.dispatch, action.payload) | ||
break | ||
case 'UI_PLAY': | ||
mediaElement.setPlaytime(state.playtime) | ||
mediaElement.play() | ||
break | ||
case 'UI_PAUSE': | ||
mediaElement.pause() | ||
break | ||
case 'UI_RESTART': | ||
mediaElement.setPlaytime(0) | ||
mediaElement.play() | ||
break | ||
case 'UPDATE_PLAYTIME': | ||
mediaElement.setPlaytime(action.payload) | ||
break | ||
} | ||
} |
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,24 @@ | ||
import actions from '../actions' | ||
|
||
import storage from 'utils/storage' | ||
import hash from 'object-hash' | ||
|
||
let podloveStorage | ||
|
||
export default (store, action) => { | ||
switch (action.type) { | ||
case 'INIT': | ||
podloveStorage = storage(hash(action.payload)) | ||
|
||
let storedPlaytime = podloveStorage.get('playtime') | ||
|
||
if (storedPlaytime !== undefined) { | ||
store.dispatch(actions.setPlaytime(storedPlaytime)) | ||
store.dispatch(actions.idle()) | ||
} | ||
break | ||
case 'SET_PLAYTIME': | ||
podloveStorage.set('playtime', action.payload) | ||
break | ||
} | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.podlove-player--truncate { | ||
white-space: nowrap; | ||
overflow: hidden; | ||
text-overflow: ellipsis; | ||
} | ||
|
||
.podlove-player--marquee { | ||
transform: translateX(0); | ||
animation: stop-and-scroll 15s linear infinite; | ||
} |
Oops, something went wrong.