View Full Version : Please help me with problem
Hofiiik
08-07-2007, 11:50 AM
I have a Video object "Video1" and a button in my project.
I want to click the button, which will open "Dialog.FileBrowse" - there I'll select a video file and this file will load into the "Video1" object - I used this script:
video_file = Dialog.FileBrowse(true, "Locate File", "C:", "All Files (*.*)|*.*|", "", "avi", false, true);
Video.Load("Video1", video_file, true, false);
and it doesn't work (there's a message "Page1 -> Button1 -> On Click, Line 3: Argument 2 must be of type string"). Could you help me?
mz241508
08-07-2007, 12:00 PM
Try this Code:
vidFile = Dialog.FileBrowse(true, "Open File", "C:\\", "Video Files (.avi, .mpg, .mpeg, .wmv, .asf, )|*.avi;*.mpg;*.mpeg;*.wmv;*.asf", "", "", false, true);
if (vidFile[1] ~= "CANCEL") then
Video.Load("Video1", vidFile[1], true, false);
end
All i did was create a new project with the video player template.
Hofiiik
08-07-2007, 12:11 PM
It works!:yes
Thank you very much!
And I've got one more question: When the video loads, is it able to resize the video object to size of the loaded video?
mz241508
08-07-2007, 12:18 PM
Your welcome! :)
Hofiiik
08-07-2007, 12:31 PM
Your welcome! :)
:lol
And don't you know answer on my second question, please?
mz241508
08-07-2007, 03:46 PM
What is the code in line 3?
Hofiiik
08-08-2007, 04:39 AM
The next lines are:
vidFile = Dialog.FileBrowse(true, "Open File", "C:\\", "Video Files (.avi, .mpg, .mpeg, .wmv, .asf, )|*.avi;*.mpg;*.mpeg;*.wmv;*.asf", "", "", false, true);
if (vidFile[1] ~= "CANCEL") then
Video.Load("Video1", vidFile[1], true, false);
end
vlastnosti = Video.GetProperties("Video1");
Video.SetPos("Video1", 2, 2);
vyska = (vlastnosti.Height)+37
sirka = (vlastnosti.Width)+4
Window.SetSize(Application.GetWndHandle(), sirka, vyska);
Or look into my project...
mz241508
08-08-2007, 04:55 AM
Try this code:
vidFile = Dialog.FileBrowse(true, "Open File", "C:\\", "Video Files (.avi, .mpg, .mpeg, .wmv, .asf, )|*.avi;*.mpg;*.mpeg;*.wmv;*.asf", "", "", false, true);
if (vidFile[1] ~= "CANCEL") then
Video.Load("Video1", vidFile[1], true, false);
end
properties = Video.GetSize("Video1");
Video.SetPos("Video1", 2, 2);
height = properties.Height+37
width = properties.Width+4
Window.SetSize(Application.GetWndHandle(), width, height);
volume = Video.GetVolume("Video1");
Input.SetText("Input1", volume);
Image.SetPos("Image1", 10, properties.Height+2);
Image.SetPos("Image2", 51, properties.Height+2);
Image.SetPos("Image3", 92, properties.Height+2);
Image.SetPos("Image4", 162, properties.Height+2);
Image.SetPos("Image5", 210, properties.Height+2);
Image.SetPos("Image6", 10, properties.Height+2);
Input.SetPos("Input1", 104, properties.Height+11);
Hofiiik
08-10-2007, 07:37 AM
It's the same - the video object doesn't change its size...
Powered by vBulletin™ Version 4.0.6 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.