Audio Player: Shuffle Queue

Authors: @szainmehdi @shea786
Type: Feature

Overview

In the audio player, users should be able to shuffle the tracks in the queue.

Why are we making this change?

A common feature of any audio player is shuffling tracks. Users expect this functionality from Nawhas.com.

Requirements

Detailed Eng Design

API

No API changes are necessary.

Frontend

We currently store upcoming tracks in a Vuex store. https://github.com/nawhas/nawhas/blob/e2ad6a3414eed217ab7f2e32918daa1cb480d3f1/web/src/store/modules/player.ts#L19-L24

Vuex Store

Some changes will need to be made to the player Vuex module.

State
Mutations
Getters

AudioPlayer Component

QueueList Component

If shuffle is on then render the ‘shuffledQueue’ array. If shuffle is off then render the ‘queue’ array

Migration Path

No changes to migration

Deployment Strategy

Mockups

Test Cases

Turning shuffle off should restore order of queue.

Expectation: Track D is now playing

Open Questions