Hi @Pawel_D.
I do not think that such object cast is possible, so that a crash could occurs on the HL device
What do you want to do? Do you want to play an audio for each step of sequence or some thing like this. I have a sample project where I am playing a model Sequence and for each sequence step it plays some audio file. I do not have access to my HL but it was working with some of the previous versions. so hopeful it will helpful for you.
//==================================
$scope.app.playAudio = function (mp3) {
var audio = new Audio(mp3);
audio.addEventListener('ended', function() {
console.warn("mp3="+mp3+" finished!")
console.warn("call the next audio from the list");
}, false);
audio.volume = 0.76;
audio.play();
};
//
//==================================
$scope.$on('stepstarted', function(evt, arg1, arg2, arg3) {
var parsedArg3 = JSON.parse(arg3);
console.log("stepName="+parsedArg3.stepName);
console.log("stepDescription="+parsedArg3.stepDescription);
console.log("nextStep="+parsedArg3.nextStep);
$scope.stepDescription=parsedArg3.stepDescription;
console.warn("Event: " + evt.name + " arg3 fields, name: " + parsedArg3.stepName + " duration(ms): " + parsedArg3.duration + " total steps: " + parsedArg3.totalSteps + " step desc: " + parsedArg3.stepDescription );
$scope.app.playAudio('app/resources/Uploaded/seq_step_'+parsedArg3.stepNumber+'.mp3');
});
/////
$scope.$watch('view.wdg["model-1"].currentStep', function(val) {
if(val !=undefined && val != "")
$scope.setWidgetProp("3DLabel-3","text","app/resources/Uploaded/seq_step_"+val+".mp3")
});
$scope.playAudio = function(){
let val=$scope.view.wdg["3DLabel-3"].text
$scope.setWidgetProp("3DAudio-1","src",val)
$timeout(()=>{twx.app.fn.triggerWidgetService("3DAudio-1", 'play');},300)
}
where the play button is linked/bind to app.view["Home"].wdg["model-1"].svc.play
app.view["Home"].wdg["model-1"].svc.play
//is the same as you tried but on UI
angular.element(document.getElementById('model-1')).scope().play();