Playing Videos with signed URLs in Android

I am currently developing an android application that will play videos from my cloudflare account. I use the ExoPlayer to display the videos into the application. I have tried using the HLS of my video (without using signed URLs) and it works fine. But if I require the video to use signed URLs, I cannot play the video. How can I use the HLS URL while keeping the “require signed URLs” option enabled?

Hi, the HLS URL works in android, that is if the stream doesn’t require signed URLs. But if the stream requires to use signed URLs, it returns 401 Unauthorized. How can I use the HLS or DASH while keeping the stream required to use signed URLs?

Hey, how are you forming the hls url when using signed URL? If you can provide an example, I could dig into it.

I use the GET method here:

https://api.cloudflare.com/#stream-videos-video-details

and from the response, I can access the hls and dash in result.playback

When using a signed url token, you should replace the video id in the hls url with the token. Did you already try that?

I have tried that, but the video won’t show in the ExoPlayer. What I am doing now as a solution is to just create a WebView then use the <iframe> of my stream

Does the signed url work when you try it here VideoJS HLS?

If you email me an example signed url (with expiration days from now), I can give look into it more. My email is [email protected]

Yes the signed url works here. I replaced the video id with the signed url token of the hls url

Does the DASH stream with signed URL also fail in exoplayer?