the-universal-common
Advanced tools
Comparing version 0.1.2 to 0.1.3
'use strict'; | ||
var commands = require('../command/Commands'); | ||
var Commands = require('../command/Commands'); | ||
var PlaybackStatus = require('../playback/PlaybackStatus'); | ||
function statusForCommand(command) { | ||
switch (command) { | ||
case Commands.PLAYBACK.PAUSE: | ||
return PlaybackStatus.PAUSED; | ||
case Commands.PLAYBACK.STOP: | ||
return PlaybackStatus.STOPPED; | ||
default: | ||
return PlaybackStatus.PLAYING; | ||
} | ||
} | ||
module.exports = function MockPlayerModule(playerEventDispatcher) { | ||
@@ -10,8 +22,8 @@ | ||
supportedCommands: [ | ||
commands.PLAYBACK.PLAY, | ||
commands.PLAYBACK.PAUSE, | ||
commands.PLAYBACK.STOP | ||
Commands.PLAYBACK.PLAY, | ||
Commands.PLAYBACK.PAUSE, | ||
Commands.PLAYBACK.STOP | ||
], | ||
onPlaybackCommand: function (command) { | ||
playerEventDispatcher.onPlaybackEvent(command); | ||
playerEventDispatcher.onPlaybackEvent(statusForCommand(command)); | ||
}, | ||
@@ -18,0 +30,0 @@ onVolumeChange: function (command) { |
{ | ||
"name": "the-universal-common", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "Static code and utilities for The Universal modules", | ||
@@ -5,0 +5,0 @@ "repository": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2110
6
53