You can create an entire mediaplayer directive, or you can use it inline using the method I described in the comments. However I feel like abstracting it makes it feel cleaner.
This plnkr contains the working example of how you can create some sort of media player directive that is bound by a state.
The resulting code in the view is minimal:
<div pf-music-player="somePlayer" file="{{fileToPlay}}"></div>
The template of the directive looks like:
<span class="btn-group">
<button class="btn" ng-disabled="state == states.Waiting || state == states.Loading"
ng-class="{
'btn-success': state == states.Stopped || state == states.Paused,
'btn-danger': state == states.Playing
}" ng-click="play()">Play</button>
<button class="btn" ng-disabled="state == states.Waiting || state == states.Loading"
ng-class="{
'btn-success': state == states.Playing || state == states.Recording,
'btn-danger': state == states.Paused
}" ng-click="pause()">Pause</button>
<button class="btn" ng-disabled="state == states.Waiting || state == states.Loading"
ng-class="{
'btn-success': state == states.Stopped || state == states.Paused,
'btn-danger': state == states.Recording
}" ng-click="record()">Record</button>
<button class="btn" ng-disabled="state == states.Waiting || state == states.Loading"
ng-class="{
'btn-success': state == states.Playing || state == states.Recording || state == states.Paused,
'btn-danger': state == states.Stopped
}" ng-click="stop()">Stop</button>
</span>
<p ng-show="state != states.Waiting && state != states.Loading">Playing {{songName}}</p>
The functions play(), pause(), record(), stop() and fields state, states and songName are supplied by the directive's link function.
For the implementation of the directive take a look at the plnkr.