2

In my SAPUI5 application I am trying to include a video, which is working very well. The video is from a media stream from SAP Gateway, which is built with OData V2. The video is shown in a custom SAPUI5-Control, very simple, just a html-video tag.

The problem is that in Chrome or Edge, the video's progress bar doesn't work. You cannot move the slider back or forth. In Firefox, on the other hand, this is no problem and the videoplayer works as expected.

I read, that Chrome and Firefox handle video processing differently. While it is Ok for Firefox to get the stream via a HTTP-200 request, Chrome requires a HTTP-206 request.

Can you tell me, if it is possible inside the ABAP-Definition of the Video-Stream, I handled this in /IWBEP/IF_MGW_APPL_SRV_RUNTIME~GET_STREAM, that I serve the stream with in a manner, chrome understands it?

My Stream Implementation in ABAP (the video is saved in the MIME Repo)

DATA LS_STREAM TYPE /IWBEP/IF_MGW_CORE_SRV_RUNTIME=>TY_S_MEDIA_RESOURCE.
DATA(LO_MIME) = CL_MIME_REPOSITORY_API=>GET_API( ).
LO_MIME->GET(
   EXPORTING
      I_URL = 'MIME_PATH/video.mp4'
   IMPORTING
      E_CONTENT = LS_STREAM-VALUE
      E_MIME_TYPE = LS_STREAM-MIMETYPE
).

IF LS_STREAM_MIMETYPE = 'video/mp4'.
   SET_HEADER( IS_HEADER = VALUE #( NAME = 'Content-Disposition' VALUE = 'inline; filename=' && |video.mp4| ) ).

COPY_DATA_TO_REF(
   EXPORTING
      IS_DATA = LS_STREAM
   CHANGING
      CR_DATA = ER_STREAM
).

I have changed my videofile with MP4TOOLS into a fragemented mp4 too.

Inside the Definition in SEGW, Media is enabled for the EntitySet.

Thank you very much

Chris
  • 63
  • 4
  • I found out that 206 is returned if the client is asking for a range. Can you try passing the Content-Range header somehow to your request? – Marc Nov 13 '21 at 12:24
  • Hi @Marc, I tried to add the Content-Range to my Response Header. My Video-File is around 80MB in size. So i tried `Content-Range: bytes 0-10000/80000000` But no luck – Chris Nov 15 '21 at 10:45

0 Answers0