Custom Video Players

By default, the Video and VideoRef components use the You.i Platform video player (CYIAbstractVideoPlayer).

To use a custom video player:

  1. Ensure the custom video player derives from CYIAbstractVideoPlayer. For details see CYIAbstractVideoPlayer Class Reference.
  2. Set the video player factory function from your app’s UserInit() function in <MyApp>/youi/src/App.cpp:

    #include <youireact/VideoPlayerFactory.h>
    // ...
    bool MyApp::UserInit()
    {
        // ...
        yi::react::VideoPlayerFactory::SetFactoryFunction([]
        {
            return std::make_unique<MyVideoPlayer>();
        });
        // ...
    }
    

The VideoPlayerFactory is a global factory that is used by the Video and VideoRef components when a player is to be instantiated.