I’m using MAUI’s MediaElement to stream a video from a server. The video is being served as a static resource, and it’s protected, so I need to send an access token when requesting the video.
I have the initial URL to fetch the .m3u8 file as follows:
mediaElement.Source = "http://localhost:5099/ContentFiles/Lesson1/index.m3u8?access_token=sampleToken";
Once this .m3u8 file is set as the source, the MediaElement generates the subsequent URLs from the content of the .m3u8 file and starts fetching the video files periodically to play.
Example URLs formed by MediaElement:
http://localhost:5099/ContentFiles/Lesson1/video1.ts
The issue is that MediaElement sends these requests without an access token, but the .ts video files are protected and require an access token.
Is there any way to instruct MediaElement to include the access token in the subsequent video requests?
Thanks in advance!
1