Loading local video works on iPad but not with iPhone.

I am using the following code to load video into a TWebMultimediaPlayer component. Works on PC, iPad but will not load video on iPhone. There is not error in the console. Tried debugging Javascript on the MAC but all seems to work correctly with no errors but the video just does not load and the onloadeddata does not fire either.

procedure TUploadForm.DlgOpenVideoChange(Sender: TObject);
var mimeType: string;
begin
  if Pos('.avi', DlgOpenVideo.Files[0].Name) >= 1 then
    mimeType := 'data:video/x-msvideo;base64,'
  else
    mimeType := 'data:video/mp4;base64,';

  DlgOpenVideo.Files[0].GetFileAsBase64(procedure (ABase64: string)
                                          var vidbase64: string;
                                          begin
                                            try
                                              PlayTimer.Enabled := false;
                                              PlayTrackBar.Position := 1;
                                              PlayTrackBar.Max := 0;
                                              vidbase64 := mimeType + ABase64;
                                              VideoPlayer.URL := vidbase64;
                                             except
                                              ShowMessage('DlgOpenVideo: Failed');
                                            end;
                                          end);
end;

Researching this indicates it might be due to the size of the video on iOS that seems to have restrictions. Can you inform whether you tested this with a small video or what the size of the video is you are testing with?

Bruno,

These are fairly small videos only about 20 seconds. On the iPhone, it does not work. On the iPad it works a few times then gets an unexpected error and reloads the page or exits the browser completely. No errors in the console. On the phone it has the latest iOS release, on the iPad it is 15.8..5. Let me know if you need any more info. Loading the same videos from the web server does not cause any issue. Only when loading local.

John

Loading local meaning you have the video stored on the device itself? You have a picker to go to photo library on the iPhone?
It would help if you have a sample source app with which I can reproduce this here.

Bruno,

Yes, the video is stored on the device. I will put together a simple example for you.

John

Here is the sample project.

MediaTest.zip (1.6 MB)

I compiled and ran this app on an iPhone (15 with iOS 18.6.2) but I could pick a video from the photo library and play it without issues multiple times.
Recording is here: