Simple to use CCVideoManager for win32, win8.1 and win10 apps. (needs some fixing though)

I had dreading moments looking for a way to get the videoplay back working on win32 windows 8.1 and windows 10. Things became even more annoying since i had to deal with managed c++ and native c++ to integrate the playback.

Finally got something working. and thought it would be best to share with the community. CCVideoManager.zip (10.1 KB)

I have also created a GitHub Repository with an example. if anyone wants to make changes feel free to do so. (I am not the great programmer and i know there are some issues that I can’t seem to figure out the solution for it).

Alright! that’s out of the way, allow me to explain how to play videos on the platforms mentioned above.

  1. Copy and paste the CCMediaPlayer.h/.cpp and CCVideoManager.h/.cpp files into your project directory.
  2. add the #include “CCVideoManager.h” where you want to call the VideoManager
  3. Use “CCVideoManager::Instance()->PlayVideo("fileDirectory/yourvideo");” to start playback.
  4. After the movie playback finishes itself, it will CCMediaPlayer will remove itself from the view.
  5. Make sure to destroy the CCVideoManager before exiting the app by calling “CCVideoManager::Instance()->DestroyInstance();”

Known issue
Although every thing seems to be working fine on Win32 app, For some reason, I can not seem to free the memory after releasing ether the CCMediaPlayer or/and the actual Control::Panel on Win8.1 and win10. I found this to be very weird since I been told that c++/cx should automatically delete the objects once the reference count reaches to zero. I have a feeling that it maybe because of a different thread but I am not an expert on this topic so it would be best if someone could take a look.

3 Likes

Hi @Yucel ,

Thanks for sharing. This works perfectly in windowed mode. But in fullscreen it doesn’t display anything and I can still hear the sounds. Any Idea how to fix this?

Thanks