Playback of MP4 files

Post Reply
HauntedMansion
Posts: 4
Joined: Thu Apr 16, 2015 8:29 pm
My devices: Apple iPad 2

Playback of MP4 files

Post by HauntedMansion »

The App Store description lists playback of MP4 files as a feature, but I can't find any reference to them in the help files or on this forum.

How do you do this?

User avatar
Mr. Kibernetik
Site Admin
Posts: 4786
Joined: Mon Nov 19, 2012 10:16 pm
My devices: iPhone, iPad, MacBook
Location: Russia
Flag: Russia

Re: Playback of MP4 files

Post by Mr. Kibernetik »

MP4 files can be controlled and played with BROWSER object.
You can check "Motion Detector" sample program in Interactive Interface section - it records from camera and plays back MP4 files (which are automatically recorded when motion in front of camera is detected).

User avatar
Mr. Kibernetik
Site Admin
Posts: 4786
Joined: Mon Nov 19, 2012 10:16 pm
My devices: iPhone, iPad, MacBook
Location: Russia
Flag: Russia

Re: Playback of MP4 files

Post by Mr. Kibernetik »

On this Forum you can check for example this: viewtopic.php?f=21&t=699 and this: viewtopic.php?f=21&t=706

Operator
Posts: 138
Joined: Mon May 06, 2013 5:52 am

Re: Playback of MP4 files

Post by Operator »

Something like this:


REM video mp4 run test
REM video out of: http://www.w3schools.com/html/html5_video.asp
REM video into smart basic using dropbox

scr_w = screen_width()
scr_h = screen_height()
BROWSER "test" AT 0,0 SIZE scr_w, scr_h
text$ = "<video controls><source src=""video/big_buck_bunny.mp4""></video>"
BROWSER "test" TEXT text$

HauntedMansion
Posts: 4
Joined: Thu Apr 16, 2015 8:29 pm
My devices: Apple iPad 2

Re: Playback of MP4 files

Post by HauntedMansion »

Thank you so much, that's exactly what I needed!

Is the embedded browser compatible with all the HTML <video> commands?

User avatar
Mr. Kibernetik
Site Admin
Posts: 4786
Joined: Mon Nov 19, 2012 10:16 pm
My devices: iPhone, iPad, MacBook
Location: Russia
Flag: Russia

Re: Playback of MP4 files

Post by Mr. Kibernetik »

The embedded browser is equivalent to Safari browser on iOS.

HauntedMansion
Posts: 4
Joined: Thu Apr 16, 2015 8:29 pm
My devices: Apple iPad 2

Re: Playback of MP4 files

Post by HauntedMansion »

Thanks for the help, I'm making progress and have videos playing.

However, I'm confused on resizing them. SET BROWSERS NORMAL seems to work fine, but whenever I use SET BROWSERS SCALED, the video shrinks to either 1/4 or 1/9 the browser window size no matter the original size of the video or the browser window.

I'd like to be able to set the size of the browser window and have the video automatically scale to fill the window. No luck so far! :D

I used the following code to try to display a 320x240 video. SET BROWSERS NORMAL nearly fills the browser as I'd expect, but setting it to SCALED shows it as a small video in the upper left 1/9 of the browser window...

SET BROWSERS SCALED
BROWSER "test" AT 100,100 SIZE 335,255
text$ = "<video><source src=""Video\TestVideo.mp4"" width=""320"" height=""240""></video>"
BROWSER "test" TEXT text$
video=browser_text$("test","var myVideo = document.getElementsByTagName('video')[0];myVideo.play();")

User avatar
Mr. Kibernetik
Site Admin
Posts: 4786
Joined: Mon Nov 19, 2012 10:16 pm
My devices: iPhone, iPad, MacBook
Location: Russia
Flag: Russia

Re: Playback of MP4 files

Post by Mr. Kibernetik »

So why do you want to use BROWSERS SCALED if NORMAL is working fine?

With SCALED option you will not get desired size anyway - browser content is scaled.

HauntedMansion
Posts: 4
Joined: Thu Apr 16, 2015 8:29 pm
My devices: Apple iPad 2

Re: Playback of MP4 files

Post by HauntedMansion »

:D

Because I want to show several different videos of unknown and varying sizes starting one after the other in the same browser window.

I guess I'm simply asking for clarification on how the scaling works. After several different combinations of window sizes and videos, I can't figure it out.

User avatar
Mr. Kibernetik
Site Admin
Posts: 4786
Joined: Mon Nov 19, 2012 10:16 pm
My devices: iPhone, iPad, MacBook
Location: Russia
Flag: Russia

Re: Playback of MP4 files

Post by Mr. Kibernetik »

Scaling is meant to fit webpage contents in the browser's window.

Post Reply