#1 2015-07-03 08:08:58

impulsmedia
Member
Registered: 2015-04-21
Posts: 64

How to change the video url dynamically in mediaplayer control

Hello,
I´ve just tried to change the URL of a movie dynamically, means by setting a var. Made some tests with CSS set style but no result. My task is to change the movie´s URL depending on the language of the user. Thank you for your help!

kind regards,
Walter

Offline

#2 2015-07-03 09:38:48

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,657
Website

Re: How to change the video url dynamically in mediaplayer control

Hello Walter,

I think you are looking for something like the MediaSetSource action?

Offline

#3 2015-07-03 14:54:50

impulsmedia
Member
Registered: 2015-04-21
Posts: 64

Re: How to change the video url dynamically in mediaplayer control

Oh my god .... to hot for me these days!!! Sorry for being a fool :-).  Another small problem I can not solve at the moment:

How do I get a JS Var into the script. My example resuklts with "undefined" in the alert ...

StartJS
firstname="duck"
EndJS

Alert "" "[firstname]"

Thanks,thanks, thanks .... 38 degrees Celsius  in  office at the moment

Offline

#4 2015-07-03 16:01:53

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,657
Website

Re: How to change the video url dynamically in mediaplayer control

Hello Walter,

You're welcome! About the Javascript variables and app variables I need to say that depends on the Javascript variable you can access it from the app or not. In other words, you can also access a Javascript variable (defined globally, not in a function, for example, because then the variable is out of the scope when the function is executed) between the "StartJS" and "EndJS" actions.

If you want to set an app variable from Javascript you can take in count that we use a "$rootScope" object to store our app variables, then we can write something like this:

StartJS
  $rootScope.firstname= 'Peter';
EndJS

AlertBox "[firstname]" "info"

But a more better way can be to declare the variable into the app and then continue writing the same as above:

SetVar "[firstname]" "" "String"

StartJS
  $rootScope.firstname = 'Peter!';
EndJS

AlertBox "[firstname]" "info"

If this answer doesn't satisfied your question, please, don't hesitate to post here any other doubt.

P.S. 25º C here right now,... but this is nothing... or the thermometer collapse during these days... or just wait a couple of hours when the sun appear here! OMG! smile

Offline

Board footer

Powered by FluxBB


Copyright ©2018 DecSoft. All rights reserved.