QAbstractVideoSurface for play video in qml
-
How to use QAbstractVideoSurface for play video in qml??
After executing the file I get error in header file
*/ mymediaplayer.h
public slots:void setVideoSurface(QAbstractVideoSurface surface);
QAbstractVideoSurface getVideoSurface();error: cannot declare parameter 'surface' to be of abstract type 'QAbstractVideoSurface'
void setVideoSurface(QAbstractVideoSurface surface);I get the error as above mentioned. ^
-
Hi,
First thing to do: you should pass a pointer to your QAbstractVideoSurface.
-
After clearing those errors,
@
MyMediaPlayer* player = new MyMediaPlayer();
QQuickView view;
view.engine()->rootContext()->setContextProperty("mediaplayer", player);
player->setMedia(QUrl::fromLocalFile("C:/Users/bharathiraja/Desktop/video.mp4"));
player->play();
@
error: invalid use of incomplete type 'class QQmlEngine'
forward declaration of class QQmlEngine -
You're missing the include of QQmlEngine.