mirror of
https://github.com/Poniverse/Pony.fm.git
synced 2024-11-29 08:07:59 +01:00
Initial commit
This commit is contained in:
parent
80146696f3
commit
3c401c44b9
1 changed files with 21 additions and 14 deletions
|
@ -93,21 +93,28 @@ module.exports = angular.module('ponyfm').factory('player', [
|
||||||
{src: track.covers.small, sizes: '100x100', type: 'image/png'}
|
{src: track.covers.small, sizes: '100x100', type: 'image/png'}
|
||||||
{src: track.covers.thumbnail, sizes: '50x50', type: 'image/png'}
|
{src: track.covers.thumbnail, sizes: '50x50', type: 'image/png'}
|
||||||
]
|
]
|
||||||
|
|
||||||
navigator.mediaSession.setActionHandler(
|
|
||||||
'play'
|
|
||||||
(() -> self.currentSound.play()))
|
|
||||||
navigator.mediaSession.setActionHandler(
|
|
||||||
'pause'
|
|
||||||
(() -> self.currentSound.pause()))
|
|
||||||
navigator.mediaSession.setActionHandler(
|
|
||||||
'previoustrack'
|
|
||||||
(() -> self.playPrev()))
|
|
||||||
navigator.mediaSession.setActionHandler(
|
|
||||||
'nexttrack'
|
|
||||||
(() -> self.playNext()))
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
navigator.mediaSession.setActionHandler(
|
||||||
|
'play'
|
||||||
|
(() -> self.currentSound.play()))
|
||||||
|
navigator.mediaSession.setActionHandler(
|
||||||
|
'pause'
|
||||||
|
(() -> self.currentSound.pause()))
|
||||||
|
navigator.mediaSession.setActionHandler(
|
||||||
|
'previoustrack'
|
||||||
|
(() -> self.playPrev()))
|
||||||
|
navigator.mediaSession.setActionHandler(
|
||||||
|
'nexttrack'
|
||||||
|
(() -> self.playNext()))
|
||||||
|
|
||||||
|
navigator.mediaSession.setPositionState(
|
||||||
|
duration: track.duration
|
||||||
|
playbackRate: 1
|
||||||
|
position: track.progressSeconds
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
self =
|
self =
|
||||||
ready: false
|
ready: false
|
||||||
isPlaying: false
|
isPlaying: false
|
||||||
|
|
Loading…
Reference in a new issue