指令
headerView.addSubview(label)
headerView.addSubview(labelValue)
headerView.addSubview(btnExpand)
headerView.sendSubviewToBack(label)
headerView.bringSubviewToFront(btnExpand)
return headerView
此处首次点击,我看到正在应用scope.pauseClass = 'fa fa-pause';
scope.muteClass = 'fa fa-volume-on';
<button ng-click="doPlayOrPause(uniqId)"><i ng-class="pauseClass"></i></button>
<button ng-click="doMute(uniqId)"><i ng-class="muteClass"></i></button>
scope.doMute = function(){
var vlc = scope.getVLC("vlc");
if (vlc && vlc.playlist.isPlaying) {
vlc.audio.toggleMute();
scope.controlClass = 'fa fa-volume-off';
}else{
scope.controlClass = 'fa fa-volume-on';
}
}
scope.doPlayOrPause = function(){
var vlc = scope.getVLC("vlc");
if(vlc){
if(vlc.playlist.isPlaying){
vlc.playlist.togglePause();
scope.controlClass = 'fa fa-play';
}else{
vlc.playlist.play();
scope.controlClass = 'fa fa-pause';
}
}
}
并显示静音图标,但再次点击该按钮时,请勿切换课程。
答案 0 :(得分:0)
如果问题不是拼写错误,你必须在控制器中设置'pauseClass'和'muteClass'的值而不是'controlClass'。
scope.doMute = function(){
var vlc = scope.getVLC("vlc");
if (vlc && vlc.playlist.isPlaying) {
vlc.audio.toggleMute();
scope.muteClass = 'fa fa-volume-off';
}else{
scope.muteClass = 'fa fa-volume-on';
}
}
scope.doPlayOrPause = function(){
var vlc = scope.getVLC("vlc");
if(vlc){
if(vlc.playlist.isPlaying){
vlc.playlist.togglePause();
scope.pauseClass = 'fa fa-play';
}else{
vlc.playlist.play();
scope.pauseClass = 'fa fa-pause';
}
}
}