I have a .ashx handler file that I use to stream files from my website. I pass a file id and the handler gets the file, sets the content type and streams it.
This works great for all the files I display in my iOS apps.
I am having an issue with the MediaElement, when I set the source to the url of the handler, it does not play the video.
If I set it to a .mov file on my site, it works fine.
source = "https://mobile.mysite.com/BuildingPatrol/GetAttachment.ashx/?AttachmentId=12345" does not work
source = "https://mobile.mysite.com/BuildingPatrol/Test.MOV" works fine
If I put the link to the handler file directly in a browser, it downloads the 12345.MOV file to the downloads folder and the .mov file plays fine.
var MediaElement = new Xamarin.CommunityToolkit.UI.Views.MediaElement()
{
//Source = "https://mobile.mysite.com/BuildingPatrol/GetAttachment.ashx/?AttachmentId=" + Attachment.AttachmentId.ToString(),
Source = "https://mobile.mysite.com/BuildingPatrol/Test.MOV",
ShowsPlaybackControls = true,
IsLooping = true,
AutoPlay = true,
HeightRequest = 200,
HorizontalOptions = LayoutOptions.FillAndExpand,
};