How to change the video url dynamically in mediaplayer control


Walter Hiller

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


DecSoft

Hello Walter,

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



Walter Hiller

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 ...

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


DecSoft

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:

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

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! :)


Todo el mundo puede leer el foro de soporte de DecSoft para aprender del mismo, sin embargo, sólo los clientes de DecSoft pueden abrir nuevos hilos. Compre una o más licencias de productos de DecSoft y obtendrá este y otros beneficios.

Este sitio utiliza "cookies" útiles para almacenar sus preferencias.

Bien. Ocultar esta nota. Obtener más información.