Link to home
Start Free TrialLog in
Avatar of Redscrapbook
RedscrapbookFlag for Ireland

asked on

JavaScript: ConfigurationData to fit a video to a full screen

I'm trying to fit the video screen as below automatically (without pressing any button to fit the screen):

See screengrab as attached.

Unfortunately, a video size is dimensions: 480 × 270px. Codecs: H.264, AAC With subtitles and it fit the width but it leave black gap on iphone screen: top and bottom of screen.

Is anyone familiar with as below hopefully to allow full screen video into 4:2 style and that mean the side will be cropped off.

// retrieve supported image modes
var imageModes = navigator.device.capture.supportedImageModes;

// Select mode that has the highest horizontal resolution
var width = 0;
var selectedmode;
for each (var mode in imageModes) {
    if (mode.width > width) {
        width = mode.width;
        selectedmode = mode;
    }
}

Open in new window



Here's the Capture API page:
http://docs.phonegap.com/en/2.1.0/cordova_media_capture_capture.md.html


I'm using QuickTime for video on iPhone. It worked well but with black top and bottom?
1full.png
Avatar of David Johnson, CD
David Johnson, CD
Flag of Canada image

Can't be done as that is a user option (full screen). also doesn't it depend upon the orientation of the iphone?
Avatar of Redscrapbook

ASKER

Thank you for your reply. May I ask why it is can't be done? When Cordova offer some solution with the code as above? So what is the code do as above if it can't be done? Please advise?

The video will automatically on landscape format.
SOLUTION
Avatar of David Johnson, CD
David Johnson, CD
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you for your reply.

Can you clarify and I'm missing the point:
If you want it soley for an iphone audience then encode it to the applicable dimensions.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
For all devices screen size with one video size 640x960, is that right?
Thank you ve3ofa for your replies and quick response. I appreciated it.