cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X

Link to Remote Media Resources

CHASEONHO
18-Opal

Link to Remote Media Resources

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

3 REPLIES 3
jmikesell
15-Moonstone
(To:CHASEONHO)

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'; 
Announcements
Top Tags