Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X
Hello,
Following code doesn't work.
$scope.assignTrustedUrl = function()
{
$scope.view.wdg['video-1'].videosrc=$sce.trustAsResourceUrl('<http://example.org/example.mp4>');
};
$scope.assignTrustedUrl2 = function()
{
$scope.view.wdg['video-1'].videosrc=$sce.trustAsResourceUrl('<https://youtu.be/zlYZVUXxs_I>');
};
how play remote media?
please let me know
Thanks.
Warm Regards,
SeonHo
I was wondering where you got that usage from and then I looked at the Studio help for remote media linking, 🤦
That exact usage show in help produces this error in the console
Error: [$sce:itype] http://errors.angularjs.org/1.5.3/$sce/itype?p0=resourceUrl
which says SCE trust call require a string value for the URL. Which is what we are passing to it.
The "old" way of doing this still works however. Either of these lines will set the video source for a video widget.
$scope.setWidgetProp('video-2', 'videosrc', video); //this is the most reliable method for setting widget properties //or $scope.view.wdg['video-2'].videosrc=video;
I'm looking into this internally. I'll post an update to this thread when I have more information.
After some code changes within Studio $sce no longer works. Our help center documentation will be updated to reflect this. We recommend linking to remote media using
$scope.view.wdg['video-1'].videosrc='http://example.org/example.mp4';