Playback of MP4 files
-
- Posts: 4
- Joined: Thu Apr 16, 2015 8:29 pm
- My devices: Apple iPad 2
Playback of MP4 files
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?
How do you do this?
- Mr. Kibernetik
- Site Admin
- Posts: 4786
- Joined: Mon Nov 19, 2012 10:16 pm
- My devices: iPhone, iPad, MacBook
- Location: Russia
- Flag:
Re: Playback of MP4 files
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).
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).
- Mr. Kibernetik
- Site Admin
- Posts: 4786
- Joined: Mon Nov 19, 2012 10:16 pm
- My devices: iPhone, iPad, MacBook
- Location: Russia
- Flag:
Re: Playback of MP4 files
On this Forum you can check for example this: viewtopic.php?f=21&t=699 and this: viewtopic.php?f=21&t=706
Re: Playback of MP4 files
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$
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$
-
- Posts: 4
- Joined: Thu Apr 16, 2015 8:29 pm
- My devices: Apple iPad 2
Re: Playback of MP4 files
Thank you so much, that's exactly what I needed!
Is the embedded browser compatible with all the HTML <video> commands?
Is the embedded browser compatible with all the HTML <video> commands?
- Mr. Kibernetik
- Site Admin
- Posts: 4786
- Joined: Mon Nov 19, 2012 10:16 pm
- My devices: iPhone, iPad, MacBook
- Location: Russia
- Flag:
Re: Playback of MP4 files
The embedded browser is equivalent to Safari browser on iOS.
-
- Posts: 4
- Joined: Thu Apr 16, 2015 8:29 pm
- My devices: Apple iPad 2
Re: Playback of MP4 files
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!
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();")
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!
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();")
- Mr. Kibernetik
- Site Admin
- Posts: 4786
- Joined: Mon Nov 19, 2012 10:16 pm
- My devices: iPhone, iPad, MacBook
- Location: Russia
- Flag:
Re: Playback of MP4 files
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.
With SCALED option you will not get desired size anyway - browser content is scaled.
-
- Posts: 4
- Joined: Thu Apr 16, 2015 8:29 pm
- My devices: Apple iPad 2
Re: Playback of MP4 files
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.
- Mr. Kibernetik
- Site Admin
- Posts: 4786
- Joined: Mon Nov 19, 2012 10:16 pm
- My devices: iPhone, iPad, MacBook
- Location: Russia
- Flag:
Re: Playback of MP4 files
Scaling is meant to fit webpage contents in the browser's window.