~fenryxo/nuvola-player/master

« back to all changes in this revision

Viewing changes to src/mainjs/mediaplayer.js

  • Committer: Jiří Janoušek
  • Date: 2018-09-17 16:46:06 UTC
  • Revision ID: git-v1:be0826483ebd9eda20d6c8186d9e98e3326b0240
Add MediaPlayer.setCanRepeat/setRepeatState

Issue: tiliado/nuvolaruntime#21

Signed-off-by: Jiří Janoušek <janousek.jiri@gmail.com>

Show diffs side-by-side

added added

removed removed

Lines of Context:
434
434
}
435
435
 
436
436
/**
 
437
 * Set whether it is possible to repeat a track or a playlist.
 
438
 *
 
439
 * If the argument is same as in the previous call, this method does nothing.
 
440
 *
 
441
 * @since Nuvola 4.13
 
442
 *
 
443
 * @param Boolean canRepeat    true if the repeat state can be changed.
 
444
 */
 
445
MediaPlayer.setCanRepeat = function (canRepeat) {
 
446
  Nuvola.actions.updateEnabledFlag(PlayerAction.REPEAT, canRepeat)
 
447
}
 
448
 
 
449
/**
 
450
 * Set the current repeat state.
 
451
 *
 
452
 * If the current state is same as the previous one, this method does nothing.
 
453
 *
 
454
 * @param PlayerRepeat repeat    The current repeat state.
 
455
 */
 
456
MediaPlayer.setRepeatState = function (repeat) {
 
457
  Nuvola.actions.updateState(PlayerAction.REPEAT, 1 * (repeat || 0))
 
458
}
 
459
 
 
460
/**
437
461
 * Add actions for media player capabilities
438
462
 *
439
463
 * For example: star rating, thumbs up/down, like/love/unlike.