The correct procedure to play a video at app startup

This forum is about all development around libVLC.
DaveCamp
New Cone
New Cone
Posts: 2
Joined: 14 Mar 2018 12:10

The correct procedure to play a video at app startup

Postby DaveCamp » 14 Mar 2018 12:27

Hiya,

Win10 x64 pro VLC 3.0.1, c++ Win32 VStudio2017 pro.

I'm moving my application to use VLC 3.0.1 as the video playback backend. I've created my own .lib file(s) from the dll(s).
I feel my issue is a simple one but as I'm relatively new to VLC I'm a little in the dark at the moment.
I want the application to load a video and show just the first frame and then pause ( as soon as the application has loaded, and also when the user selects another media file ). My application uses its own child window for VLC to render to.

I've tried loading and playing the video during the WM_CREATE method but this doesn't work - I get a blank video while the audio plays. This method works ok if I don't set the hWnd which means that a new window opens on top of my application which is not what I want. My own child window is set up as a window of class "STATIC" and style of WS_CHILD | WS_VISIBLE ). After some testing I understand that I'm starting the video too prematurely during the application start up phase. Everything works ok if let the app start without attempting to play the video and have the user press a 'play' button.

What event should I be dealing with to know when the media file has fully loaded properly? bearing in mind that I'd like to show the first frame as soon as the application is started.
Thanks

DaveCamp
New Cone
New Cone
Posts: 2
Joined: 14 Mar 2018 12:10

Re: The correct procedure to play a video at app startup

Postby DaveCamp » 15 Mar 2018 15:43

It looks like the correct procedure is to create the child window ( the presentation window ) as 0, 0 size and resize it after attaching it to vlc engine.
I'll test some more to make sure the issue really is resolved.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 19 guests