daily pastebin goal
45%
SHARE
TWEET

lib.request.addItemToPlaylist.js

a guest Dec 17th, 2018 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 'use strict';
  2. var RequestMediaRenderer = require('../lib.base.requestMediaRenderer');
  3.  
  4.  
  5. module.exports = class Request_AddItemToPlaylist extends RequestMediaRenderer
  6. {
  7.     constructor()
  8.     {
  9.         super();
  10.         this.mediaRenderer = null;
  11.     }
  12.        
  13.        
  14.     runAction(_resolve, _reject, _mediaRendererVirtual, _mediaRendererRoom, _roomUdn)
  15.     {
  16.  
  17.         var id = this.getQueryValue("id");
  18.         var _playlistName = this.getQueryValue("playlist");
  19.         var mediaRenderer = this.managerDisposer.deviceManager.getVirtualMediaRenderer(id);
  20.         var _mediaItemId = mediaRenderer.rendererState.mediaItem.refID;
  21.        
  22.         if(_mediaItemId)
  23.         {
  24.             this.raumkernel.nativePlaylistController.addItemToPlaylist(_playlistName, _mediaItemId).then(function(_data){
  25.                     _resolve(_data);
  26.                 }).catch(function(_data){
  27.                     _reject(_data);
  28.                 });
  29.         }
  30.         else
  31.         {
  32.             _reject(new Error("Current track is not available!"));
  33.         }
  34.     }
  35.  
  36. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top