3GP Player 2008 is a freeware application that makes an OK videoplayer. This application is a really simplistic take at the problem of mobile format playback. Alien DVR (Single Channel) Player is an application that can be used to playback multiple downloaded video clips from alienDVRs in synchronised time. It can currently playback 4 downloaded videos simultaneously. The package doesn't need installation because it's provided as portable which means you can launch the file directly without installation.
-->[MFPlay is available for use in the operating systems specified in the Requirements section. It may be altered or unavailable in subsequent versions. ]
This tutorial presents a complete application that plays video using MFPlay. It is based on the SimplePlay SDK sample.
This tutorial contains the following sections:
For a more detailed discussion of the MFPlay API, see Getting Started with MFPlay.
Requirements
MFPlay requires Windows 7.
Header and Library Files
Include the following header files in your project:
Link to the following code libraries:
- mfplay.lib
- shlwapi.lib
Global Variables
Declare the following global variables:
These variables will be used as follows:
g_hwnd
A handle to the application window.
g_bVideo
A Boolean value that tracks whether video is playing.
g_pPlayer
A pointer to the IMFPMediaPlayer interface. This interface is used to control playback.
g_pCallback
A pointer to the IMFPMediaPlayerCallback interface. The application implements this callback interface to get notifications from the player object.
Declare the Callback Class
To get event notifications from the player object, the application must implement the IMFPMediaPlayerCallback interface. The following code declares a class that implements the interface. The only member variable is m_cRef, which stores the reference count.
The IUnknown methods are implemented inline. The implementation of the IMFPMediaPlayerCallback::OnMediaPlayerEvent method is shown later; see Implement the Callback Method.
Declare the SafeRelease Function
Throughout this tutorial, the SafeRelease function is used to release interface pointers:
Open a Media File
The
PlayMediaFile
function opens a media file, as follows:- If g_pPlayer is NULL, the function calls MFPCreateMediaPlayer to create a new instance of the media player object. The input parameters to MFPCreateMediaPlayer include a pointer to the callback interface and a handle to the video window.
- To open the media file, the function calls IMFPMediaPlayer::CreateMediaItemFromURL, passing in the URL of the file. This method completes asynchronously. When it completes, the application's IMFPMediaPlayerCallback::OnMediaPlayerEvent method is called.
The
OnFileOpen
function displays the common file dialog, which enables the user to select a file for playback. The IFileOpenDialog interface is used to display the common file dialog. This interface is part of the Windows Shell APIs; it was introduced in Windows Vista as a replacement for the older GetOpenFileName function. After the user selects a file, OnFileOpen
calls PlayMediaFile
to start playback.Window Message Handlers
Next, declare message handlers for the following window messages:
- WM_PAINT
- WM_SIZE
- WM_CLOSE
For the WM_PAINT message, you must track whether video is currently playing. If so, call the IMFPMediaPlayer::UpdateVideo method. This method causes the player object to redraw the most recent video frame.
If there is no video, the application is responsible for painting the window. For this tutorial, the application simply calls the GDI FillRect function to fill the entire client area.
For the WM_SIZE message, call IMFPMediaPlayer::UpdateVideo. This method causes the player object to readjust the video to match the current size of the window. Note that UpdateVideo is used for both WM_PAINT and WM_SIZE.
For the WM_CLOSE message, release the IMFPMediaPlayer and IMFPMediaPlayerCallback pointers.
Implement the Callback Method
The IMFPMediaPlayerCallback interface defines a single method, OnMediaPlayerEvent. This method notifies the application whenever an event occurs during playback. The method takes one parameter, a pointer to an MFP_EVENT_HEADER structure. The eEventType member of the structure specifies the event that occurred.
The MFP_EVENT_HEADER structure may be followed by additional data. For each event type, a macro is defined that casts the MFP_EVENT_HEADER pointer to an event-specific structure. (See MFP_EVENT_TYPE.)
For this tutorial, two events are significant:
Event | Description |
---|---|
MFP_EVENT_TYPE_MEDIAITEM_CREATED | Sent when the CreateMediaItemFromURL completes. |
MFP_EVENT_TYPE_MEDIAITEM_SET | Sent when SetMediaItem completes. |
The following code shows how to cast the MFP_EVENT_HEADER pointer to the event-specific structure.
The MFP_EVENT_TYPE_MEDIAITEM_CREATED event notifies the application that the IMFPMediaPlayer::CreateMediaItemFromURL method has completed. The event structure contains a pointer to the IMFPMediaItem interface, which represents the media item created from the URL. To queue the item for playback, pass this pointer to the IMFPMediaPlayer::SetMediaItem method:
The MFP_EVENT_TYPE_MEDIAITEM_SET event notifies the application that SetMediaItem has completed. Call IMFPMediaPlayer::Play to start playback:
Implement WinMain
In the remainder of this tutorial, there are no calls to Media Foundation APIs. The following code shows the window procedure:
The
InitializeWindow
function registers the application's window class and creates the window.Finally, implement the application entry point:
Related topics
-->Oct 24,2019• Proven solutions
Video players are one of the biggest needs of youngsters these days. No matter whether you use a window device, working on Mac, Linux or iOS or it is an Android mobile; you will always need a user friendly video player for your device. There are so many tools available over internet but the list below contains some of the best options. This article will provide you information about 12 popular best free video players on PC for Window, Android, iOS, Linux and Mac platforms.
A. Free Video Player for Windows:
1. VLC:
Here is your free open source tool that is well rated as a cross platform type multimedia player. This framework can play almost all popular multimedia files and is also equipped with advanced streaming protocols. It can play everything ranging between streams, devices, webcams, discs and files. You will not need any specialized encoder for playing classic video files like MP3, WMV, WebM, MKV, H.264, MPEG-4 and MPEG-2. The best thing to know about VLC media player is that it is complete free: no user tracking, no annoying ads and no spyware issues.
2. GOM Player:
GOM player is also available for free; anyone can download it from internet and start playing videos. It offers comprehensive file support where you can enjoy MOV, WMV, FLV, MKV, MP4 and AVI etc. Further, it extends strong subtitle functionality where users can easily adjust sync settings, size and placement etc. You will be glad to know that it can play 360 degree videos and controls can be directly initiated from mouse or keyboard. Few advanced features include: video effects, playback speed controls, media player capture, screen capture and A-B repeat abilities.
B. Free Video Player for Mac:
3. MPlayerX:
It provides highly smooth, clear and effective playback. People love to make this software dance on their fingers as it allows easy tap, swipe and pinch controls for playbacks. MPlayer X is capable enough to convert and detect any encoding method for subtitles with ease. One can easily manage video and YouTube videos with one click access on MPlayerX. The best part to know about this free media tool is that you need not to apply additional settings on it for fast streaming. Simply plug in your SPDIF cable and this player will recognise it immediately. It will soon generate required DTS/AC3 stream.
4. Elmedia Player:
Here is a super versatile application for you all that can handle all media file formats like M4V, FLAC, MP3, MKV, DAT, MOV, AVI, MP4 and FLV etc. Elmedia can ensure smoother functioning for HD playback and you will not face any slowdown or interruption in between. You will never find any issue related to synchronization or videos with audios on this media platform. Elmedia allows playback speed adjustment facility where audio as well as video files can be looped easily. The best part is its ability to create bookmarks so that you can easily return to your last track.
C. Free Video Player for Linux:
5. Miro:
It is 100% free and open source video player for Linux users that can manage all your media file related frustrations with ease. Miro is much easier to download and install and once it is loaded to your device then it can keep everything organised in your media file folder. It also accompanies a interactive media file format converter so no matter which format you have for your favourite media file, this player can easily convert it into MP4 and will play with ease. Users can also buy wide range of music or videos from Miro as it is equipped with Amazon MP3 store.
6. MPV:
If you are searching for a tool that can ensure high quality output for video files then Miro is simply the best option for your Linux device. It is designed with advanced algorithms and has ability to do video scaling with color management, interpolation and frae timing adjustments. Here is one unique fact about MPV that it does not possess any official GUI rather its small intuitive controller can be operated using mouse movements.
D. Free Video Player for iOS:
7. Infuse-By Firecore:
There are so many incredible features to discuss about Infuse-By Firecore. It can handle WMV, MP4, AVI, MKV and many other popular file formats. The best thing to know about Infuse-By Firecore is its ability to play 4K ultra HD videos with silky smooth appearances. The battery friendly hardware decoding makes everything much easier. iOS users always love to stay in style, so this video player is designed to suit their personality. It has native multi tasking abilities and also supports drag and drop feature for media transfers.
8. MCPlayer:
Here is a wireless streaming software tool for iPhone and iPad users. It can assist you all to watch wide range of video files with easy interaction. This is a specially designed High definition type player for iOS devices where you can stream media content directly from internet. It never even demands trans-coding and playback on local network is also much easier. MCplayer also supports subtitles and can manage your list of favourites with well designed document section.
E. Free Video Player for Android:
9. KM Player:
KM player is highly recommended video player for Android and desktop users due to its higher compatibility. Users of this video player are growing day by day as it offers so many advanced and incredible inbuilt features. On can easily access TV shows, Movies, Animations, video files, Mobile phone videos as well as homemade content on this software tool. KM Player is currently available in 30 different languages and it supports HD content.
10. AC3 Player:
You need not to install any additional plugin to play your video files on AC3 Player. Further, it can support all subtitle formats while offering automatic synchronization, control with playing gestures, play history list, sleep time settings and playback speed control abilities. It will take very less space in your device and offers quick start operation with simple management functions.
F. Free Video Player for Windows Phone:
11. ccPlayer (Free/Paid versions):
ccPlayer support almost all subtitle styles with advanced support to encoded videos. It is being used by almost 1.7 million people throughout the world. You can also play many advanced video file formats on this player like RMVB, FLV and MKV etc. ccPlayer is best option for beginners as well as professional video lovers.
12. QuickPlay:
Here is an all in one solution for your media file needs; it’s beautiful, simple and clean design allows everything to be managed with one click. Using QuickPlay, you can play video files in fast forward mode. It also allows easy search options for sound tracks that are stored inside folders. Its background colours can be easily customized by users.
Easy-to-use and powerful video editor for all creators.
Bring up your video to a professional level with straightforward tools.
- Choosing Video Editing Software
- Video Editing Tips