Loading video in html5 local file

I am trying to open a local html5 file which plays a local video
following is xojo code
dim htmlFile as FolderItem = GetFolderItem(“test4Xojo.html”)

If htmlFile <> Nil And htmlFile.Exists Then
Dim html As String

Dim htmlInput As TextInputStream

Try
  
  htmlInput = TextInputStream.Open(htmlFile)
  
  html = htmlInput.ReadAll
  
  htmlInput.Close
  
Catch e As IOException
  
  html = "<html><body><h1>Error loading file on server.</h1></body></html>"
  
End Try
htmlView.LoadPage(html,NIL)

End If

THE HTML5CODe which works well in browser is :

This is a test

In the Xojo test Debug the html text loads but video is not getting loaded
Pls help. Learning XOJO

I suspect it’s because it can’t locate small.mp4. It looks to be a relative path so it can’t resolve that. What does that mean when the HTML is loaded internally?

You might need to parse the src out, and find that file, and do a more relevant path.

You don’t need TextInputStream

[code] dim htmlFile as FolderItem = GetFolderItem(“test4Xojo.html”)

If htmlFile <> Nil And htmlFile.Exists Then
htmlView.LoadPage(htmlFile)
End If[/code]

HTML

[code]

This is a test

[/code]

Hi Alex
Thanks. That works.