WebMoviePlayer question.

  1. ‹ Older
  2. 4 months ago

    Daniel W

    Mar 7 Answer Australia

    WebFiles work great for that sort of thing!
    http://developer.xojo.com/webfile

  3. Brian O

    Mar 8 Pre-Release Testers Calgary, AB
    Edited 4 months ago

    Well my videos aren't playing...
    It would seem that the WebFileURL doesn't have http: or file: prepended to it.
    I am assuming the extension is irrelevant. mp4 or mpg or mpeg or mpeg-2
    i have tried mime type video/mp4 and video/mpg...
    no luck.

  4. Dave S

    Mar 8 San Diego, California USA
    Edited 4 months ago

    @Brian OBrien I am assuming the extension is irrelevant. mp4 or mpg or mpeg or mpeg-2

    I would not assume so, since as you posted

    The URLs must be actual URLs that would also work in a web browser

    and without the extension, the URL is incomplete

  5. Tim P

    Mar 8 Pre-Release Testers, XDC Speakers

    @Brian OBrien It would seem that the WebFileURL doesn't have http: or file: prepended to it.

    If it starts with just // (like for example the url is: //myserver.com/videofile.mp4) it's a special shortcut that tells the browser to use the same protocol it's already on. This means if you load your web app on https:// and the file URL is //myserver.com/videofile.mp4, then the browser will use https://myserver.com/videofile.mp4

  6. Brian O

    Mar 8 Pre-Release Testers Calgary, AB
    Edited 4 months ago

    I've posted a demo project here
    Everything looks ok to me in code but nothing plays....

    Care to take a look?

    The URL i've formed is
    MoviePlayer1.DesktopURL=Files(0).File.URLPath
    file:///private/var/folders/8_/p8x5jhqs1ll0jt5bzs5t8f800000gn/T/TemporaryItems/3

    The mp4 is in a MemoryBlock from the file upload.
    I can not pass the memory block to the movie player for it to play.
    I have to write it to disk (forcedownload) and then form a url to that file that 'my app' will serve when the client requests it?

    Should I mangle this URL into http to my host and port... 3 doesn't look like

    One might think the url needs to be formed differently depending on who and where the client is?

    I'm testing my server on localhost,127.0.0.1:8080, which is also where I'm running the browser. (Chrome)

    If I use showURL then video plays but then it starts popping up in a new window or it takes over the entire browser display...

  7. Daniel W

    Mar 8 Australia

    I had a quick look,
    I changed

    MoviePlayer1.DesktopURL=Files(0).File.URLPath  //MyWebFile.URL

    to..

    MoviePlayer1.DesktopURL=MyWebFile.URL

    Seemed to work with a webm file I downloaded but it failed with a mp4 file I had... Don't have time to find out why though!

  8. Brian O

    Mar 8 Pre-Release Testers Calgary, AB

    no luck me...

    This is the url i ended up forming ...

    http://192.168.0.21:8080/6197E49DBB49FE03F1C9D997F122CE8EDB27E400/files/4206-3084-5042-3285-7730/videoplayback.mp4

    The stuff in bold i put in myself as that's where I believe I'm serving from...
    The WebMoviePlayer isn't playing it... but VLC / open network.. The video is playing fine.

    I'm on a mac on chrome... hmm... h264?

  9. Daniel W

    Mar 8 Australia

    If you open that link with your browser, does it play or offer a download?

  10. Brian O

    Mar 8 Pre-Release Testers Calgary, AB

    Depending on what type of media. AVI got downloaded mp4 did nothing. I'm trying mov now then mpeg.
    I don't know if you know VLC but it's a media player. It has a file open network. I copy the url into that application and the video plays.

  11. Brian O

    Mar 8 Pre-Release Testers Calgary, AB

    I'm tempted to put a HtmlViewer?

    <!DOCTYPE html> 
    <html> 
    <body> 
    <video width="320" height="240" controls>
      <source src="movie.mp4" type="video/mp4">
    Your browser does not support the video tag.
    </video>
    </body> 
    </html>
  12. Daniel W

    Mar 8 Australia

    That might work. I would build a webSDK control. The problem with htmlViewers is they place the control in an i-frame that is out of your reach.

    I havn't tried to use the webmovieplayer before but it seems to use flash not HTML5, for this reason alone I would opt for building a webSDK control.

    However, by the sounds of it, the real issue is video codec browser compatibility. does the video play if you load it directly from the browser?
    example:

    file:///home/myuser/myvdieofile.mp4
  13. Brian O

    Mar 9 Pre-Release Testers Calgary, AB

    I was just looking for iFrames.. how ironic.

    The video do not play directly from the browser they download.

    When they say htmlViewer do they mean html5?
    I'm on a mac so flash is a pain.

    I was just going to use a custompagesource and stuff it with the html5 example code from w3schools.
    I would then set the video url in the html source.

    I'm wondering where I'm going to get the resolution of the videostream, as the html5 seems to be able to use it.. but maybe it doesn't need it.

  14. Christian S

    Mar 10 Pre-Release Testers, Xojo Pro, XDC Speakers Germany

    I would say: WebFile is bad for WebMoviePlayer!
    The Xojo web app has better things to do than streaming video.

    Better just put the video on some URL pointing to a Webserver and let the Webserver deliver it.
    If needed, add temporary HTTP Access password or generate new random URL to video.

  15. Brian O

    Mar 10 Pre-Release Testers Calgary, AB

    It works...
    Pretty limited functionality mp4 only.
    I guess everything needs to be transcoded with ffmpeg for reliability.

    Here is the project. Thanks for the help.
    No encrypted urls yet.. soon come.
    Movie Player and html5

  16. Daniel W

    Mar 11 Australia

    Thanks for sharing the code Brian!

    Did you get better video codec compatibility by using the html5 player?

  17. Brian O

    Mar 12 Pre-Release Testers Calgary, AB

    If i remember correctly i put a MoviePlayer and a html5 player ...
    mp4 seems to be about the only thing properly supported.
    avi mpg.. pfff.. not much luck.
    I get the feeling people played to lose with file extensions to document what the data the file is and it probably isn't what they think it is.

  18. 3 months ago

    Daniel W

    Apr 18 Australia

    Found these in the 2018r1 release notes.
    19275 Framework » Web WebMoviePlayer now shows native HTML5 video controls on all supported browsers.
    37367 Framework » Web WebMoviePlayer now uses the native HTML5 video player for all browsers.

  19. Brian O

    Apr 18 Pre-Release Testers Calgary, AB
    Edited 3 months ago

    Ya.. did something like this:

    dim html5 as string = _
      "<!DOCTYPE html> " +_
      "<html> " +_
      "<body> " +_
      "<video width=" + chr(34) + "320"+ chr(34) + " height=" + chr(34) + "240" + chr(34) + " controls>" +_
      "<source src=" + chr(34) + "URL" + chr(34) + " type=" + chr(34) + "MIME"+ chr(34) + ">" +_
      "Your browser does not support the video tag." +_
      "</video>" +_
      "</body>" +_
      "</html>"
      
        dim html5 as string = _
      "<!DOCTYPE html> " +_
      "<html> " +_
      "<body> " +_
      "<video width=" + chr(34) + "320"+ chr(34) + " height=" + chr(34) + "240" + chr(34) + " controls>" +_
      "<source src=" + chr(34) + "URL" + chr(34) + " type=" + chr(34) + "MIME"+ chr(34) + ">" +_
      "Your browser does not support the video tag." +_
      "</video>" +_
      "</body>" +_
      "</html>"
      
      html5 = replaceall(html5, "URL", MyWebFile.URL)
      html5 = replaceall(html5, "MIME", MyWebFile.MIMEType)
      HTMLViewer1.LoadPage(html5)

    The question is is a HTMLViewer html5 ready?

  20. Greg O

    Apr 18 Xojo Inc Somewhere near Raleigh, NC

    @Brian OBrien The question is is a HTMLViewer html5 ready?

    Desktop, it depends. Web, yes, it’s just an iframe.

  21. Greg O

    Apr 18 Xojo Inc Somewhere near Raleigh, NC

    @Brian OBrien avi mpg.. pfff.. not much luck.

    This hasn’t changed. But you can still use ogv files for Firefox if you want. The goal was to get the APIs updated (now that we can) and to have all supported browsers use the same format so you don’t have to serve different ones for each platform/browser.

    You should be able to use an H.264 m4v file on all supported browsers.

or Sign Up to reply!