video widget not working in ios for binary data

Hi guys, 

i've been struggling with this one all day.  I have an ordinary video widget dropped into a mobile screen.

i'm getting the content via RESTful endpoint like "/Espace/endpoint?fileid=" +fileid

works great on debug desktop and android but dies on ios.  in the endpoint the mime output is octet-stream.  i've tried changing the response code to 406 (whatever the part-content chunking one is) and tried all sorts of different ways to get and serve the binarydata but can't get it to work in ios.  

Anyone had this struggle and figured it out?  happy for RESTful solution or just streaming the damned file from the local db.

Solution

Hi Steve,

I don't have any clue about why direct stream doesn't work on IOS but anyway I have a solution you can try.

Basically, OutSystems video widget is an HTML5 video tag. That tag allows using a base64 string also.
You can use the following way for android and ios or run different action for each platform. It's your choice.

1. Add reference BinaryToBase64 function to your project.


2. Add a data source to your screen and call your REST API to get your video


3. Edit GetVideo action and convert your binary result to base64 string.

3. OnAfterFetch you can assign the result to Base64 local variable like following

SyntaxEditor Code Snippet

"data:video/mp4;base64," + GetVideo.Out1

4. Set your video component source to the local variable Base64

Result on Apple IPhone

It works with base64 stream

It doesn't work direct binary stream


Hope it will be helpful for your case.


With best regards,
F.Karatay

Solution

You're a champion Ferhat.  thanks very much.  After struggling with this all day, i should have taken the time to look at the clue right in front of me and concentrated on changing the way i was serving the binarydata.

I solved it about 20 miutes ago with the Binary Data Streamer extension but I'm marking your solution as correct because a) it's pretty cool and b) you put the effort in to help me (once again) . 

Thanks mate.

Steve