Capture playback permission
This commit is contained in:
parent
a18bca9d8c
commit
9fabbd5746
9 changed files with 77 additions and 4 deletions
|
@ -7,6 +7,7 @@ import datetime from 'datetime';
|
|||
import toast from 'toast';
|
||||
import actionsheet from 'actionsheet';
|
||||
import globalize from 'globalize';
|
||||
import playbackPermissionManager from 'playbackPermissionManager';
|
||||
|
||||
/**
|
||||
* Gets active player id.
|
||||
|
@ -153,6 +154,16 @@ events.on(syncplayManager, 'SyncplayEnabled', function (e, enabled) {
|
|||
export function show(button) {
|
||||
loading.show();
|
||||
|
||||
// TODO: should feature be disabled if playback permission is missing?
|
||||
playbackPermissionManager.check().then(() => {
|
||||
console.debug("Playback is allowed.");
|
||||
}).catch((error) => {
|
||||
console.error("Playback not allowed!", error);
|
||||
toast({
|
||||
text: globalize.translate("MessageSyncplayPlaybackPermissionRequired")
|
||||
});
|
||||
});
|
||||
|
||||
const apiClient = connectionManager.currentApiClient();
|
||||
connectionManager.user(apiClient).then((user) => {
|
||||
if (syncplayEnabled) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue