Java Media Player J/Direct Sample
This sample is located in \Samples\JDirect\MediaPlayer.
Description
Using the Sample
Key Project Files
Technologies Demonstrated
Description
The Java Media Player calls one function (MCISendCommand) to play different media files (audio and video) for the Microsoft® Windows® format.
Using the Sample
To run the sample
- Type the following command in the %SDKDIR%\Samples\Jdirect\MediaPlayer directory to build the MediaPlayer.class file from the Java source file:
Nmake MediaPlayer
This also builds the MediaPlayer.exe file.
- Run MediaPlayer.exe from the same directory.
- Select the media you want to play from the Device menu. The choices are:
- Sound plays a .wav file.
- MIDI Sequencer plays a .midi file.
- CD Audio plays a track from a CD. If you select this mode, make sure to first insert an audio compact disc into the CD-ROM drive.
- Video for Windows plays an .avi file
- Select a file from the dialog box and click Open.
- Click Play in the media player. (The Pause button will pause the file. When you click Play a second time, it continues from the point at which it was paused.)
- Alternatively, you can open the media files from the File menu.
Help Topics in the Help menu contains detailed information on how to play the different media.
If you select About in the Help menu, you will see a 3-D walk-through maze. This simple maze demonstrates Raycasting. To move through the maze, just click the buttons at the bottom. The maze does not contain texture mapping.
Key Project Files
formMediaPlayer.java
This class can take a variable number of parameters on the command line. Program execution begins with the main method. The class constructor is not invoked unless an object of type formMediaPlayer is created in the main method.
Technologies Demonstrated
J/Direct
- This sample shows how to implement Windows Foundation Classes controls and Microsoft® J/Direct.
© 1999 Microsoft Corporation. All rights reserved. Terms of use.