because so far I see, the post (question by @Ace_Rothstein ) is already closed and there is no possible to add a solution or workaround to this post, therefore I want to open extra topic for some further considerations of the issue and will try to provide a solution /workaround for this item.
Following steps:
1.)To be able to get access to an audio or video widget first we need to receive the audio object. To get the angular element object of the audio widget following js code could be used:
var nameAudio="audio-1'
var myaudio = angular.element(document.querySelector('twx-widget[widget-id=\"'+nameAudio+'\"] audio'));
2.)The next step is to set the value of the control mute property to the toggle value / negated value = ! toggle.value
e.g.:
let toggle =! $scope.view.wdg[nameToggle].value
myaudio[0].volume = toggle;
$scope.$applyAsync()
3.)you can define a function implementing the point 1 and 2 and set this function to the toggle Wdiget UI JS Box change event:
The function definition could be something like this:
$scope.toggleAudio = function(nameAudio,nameToggle) {
var myaudio = angular.element(document.querySelector('twx-widget[widget-id=\"'+nameAudio+'\"] audio'));
let toggle =! $scope.view.wdg[nameToggle].value
myaudio[0].volume = toggle;
$scope.$applyAsync()
}
4.) Now when we test it - we will the desired behavior :
I attached a project example which demonstrates the issue /implements a demo solution
Solved! Go to Solution.
Great! That is an amazing solution. Precisely what I was looking for.
Great! That is an amazing solution. Precisely what I was looking for.