When you say "token authentication", do you mean authentication of a stream from FMS (or a CDN), or something different? If the former, then it depends on which CDN, as they generally do it differently (though it's usually specified as query parameters in the URL).
Authentication Tokens are usually used to authenticate against a server, and therefore are usually passed as parameters on the URL to the server. The only case where you need to use the DRMTrait is if you are using a DRM solution , such as Flash Access. Here is an example of a URL with authentication embedded:
I mean token authentication against a CDN, so y need to add a parameter to the video url like this:
so I do this:
_element = _mediaFactory.createMediaElement(new URLResource(_src));
When I try to play this MediaElement with my mediaplayer instance it throws a MediaErrorEvent like this:
Error: Playback failed
¿is this the right way? may be a problem with my token
thanks for your help
Yes, that looks right.
may be it looks good, but doesn't work.
It does work.
OSMF handles token authorisation by default, so you shouldn't do anything else apart from retreivng the urls from base attribute.
It usually looks likee this
Token is automatically taken from the URL and my guess it's passed later on as URLVariables object.
It seems to be working fine. The only problem is what happens when tokens expire.
So let's assume you have a playlist service, that returns you stream location.
Once you get a response from your service you have limited time to establish a connection with the token you get.
What if token expired and you lost a connection?
That pretty much means you need to request new token (that is obviously done outside of OSMF), but then there is no way
of actually injecting the token for a reconnect. Or at least I haven't found any.
Can someone suggest an acceptable solution to this?