PC SOFT
ONLINE REPOSITORY
FOR WINDEVWEBDEV AND WINDEV MOBILE

Home |  | Sign in | English US
WD Play a video mp4, mov, avi, mpg
Published by Boller
- Unclassified
New features



Description




// Select the video file
sFile is string
sFile = fSelect(EDT_FILE,"Select a video file...",...
"Video files (*.avi)"+TAB+"*.avi"+CR+...
"MPG video files (*.mpg)"+TAB+"*.mpg"+CR+...
"Mp4 video files (*.mp4)"+TAB+"*.mp4"+CR+...
"Quick Time files (*.mov)"+TAB+"*.mov"+CR+...
"All files (*.*)"+TAB+"*.*",...
"*",fselOpen+fselExist)

WinRedraw()

// If a file was selected
IF sFile<>"" THEN
EDT_FILE=sFile

// Close the previous Video file if there is one
// No action otherwise
MCIClose("MyVideo")

// Open the selected Video file
// "MyVideo" is the logical name (alias) chosen arbitrarily
// this name will be used to handle the file
// IMG_VIDEO is the image control where the video will be displayed
MCIOpen(EDT_FILE,"MyVideo",MciStyleChild,IMG_VIDEO)

// If the opening failed
IF ErrorOccurred THEN
// Display the status report
Error(ErrorInfo())
END
END

//------------------------------------------------------------------------

// Play the selected video
// Reminder: "MyVideo" is the logical name chosen for this file when it was opened
MCIPlay("MyVideo")

//-----------------------------------------------------------------------

// Pause the selected video
// Reminder: "MyVideo" is the logical name chosen for this file when it was opened
MCIPause("MyVideo")

//-----------------------------------------------------------------------

// Stop reading the selected video
// Reminder: "MyVideo" is the logical name chosen for this file when it was opened
MCIStopPlaying("MyVideo")

// Reposition at the beginning of the file
// When the user asks to read the file again, the read operation will start from the beginning
MCIBeginning("MyVideo")

//-------------------------------------------------------------

// Initialize the value of the slider
// The bounds of the slider are 0 - 65535
// Tune all the files: WAV, MP3...
VOLUME_SLIDER = MCIVolume("WAV",MciRightVolume)

// Tune the volume (use syntax #2 of MCIVolume)
// Tune all the files: WAV, MP3...
MCIVolume("WAV",MciRightVolume,VOLUME_SLIDER)
Illustrations, screen shots
none
none
User reviews
(To evaluate this resource, click 'Write a review')
No review or comment? Be the first one!