#include <QtCore/QCoreApplication>
#include <QtGui/QGuiApplication>
#include <QtQuick/QQuickView>
#include <VLCQtCore/Common.h>
#include <VLCQtQml/QmlSource.h>
#include <VLCQtCore/TrackModel.h>
#include <VLCQtQml/Qml.h>
#include <VLCQtQml/QmlVideoObject.h>
#include <VLCQtCore/MediaPlayer.h>
#include <VLCQtQml/QmlPlayer.h>
#include <VLCQtQml/QmlVideoOutput.h>
#include <QtPlugin>
int main(int argc, char *argv[])
{
QGuiApplication app(argc, argv);
VlcCommon::setPluginPath(app.applicationDirPath() + "/plugins");
qmlRegisterUncreatableType<Vlc>("Vlc", 1, 1, "Vlc", QStringLiteral("Vlc cannot be instantiated directly"));
qmlRegisterUncreatableType<VlcQmlSource>("VlcSource", 1, 1, "VlcSource", QStringLiteral("VlcQmlSource cannot be instantiated directly"));
qmlRegisterUncreatableType<VlcTrackModel>("VlcTrackModel", 1, 1, "VlcTrackModel", QStringLiteral("VlcTrackModel cannot be instantiated directly"));
qmlRegisterType<VlcQmlVideoOutput>("VlcVideoOutput", 1, 1, "VlcVideoOutput");
qmlRegisterType<VlcQmlPlayer>("VlcPlayer", 1, 1, "VlcPlayer");
#include <QtCore/QCoreApplication>
#include <QtGui/QGuiApplication>
#include <QtQuick/QQuickView>
#include <VLCQtCore/Common.h>
#include <VLCQtQml/QmlSource.h>
#include <VLCQtCore/TrackModel.h>
#include <VLCQtQml/Qml.h>
#include <VLCQtQml/QmlVideoObject.h>
#include <VLCQtCore/MediaPlayer.h>
#include <VLCQtQml/QmlPlayer.h>
#include <VLCQtQml/QmlVideoOutput.h>
#include <QtPlugin>
int main(int argc, char *argv[])
{
QCoreApplication::setApplicationName("VLC-Qt QML Player");
QCoreApplication::setAttribute(Qt::AA_X11InitThreads);
QGuiApplication app(argc, argv);
VlcCommon::setPluginPath(app.applicationDirPath() + "/plugins");
qmlRegisterUncreatableType<Vlc>("Vlc", 1, 1, "Vlc", QStringLiteral("Vlc cannot be instantiated directly"));
qmlRegisterUncreatableType<VlcQmlSource>("VlcSource", 1, 1, "VlcSource", QStringLiteral("VlcQmlSource cannot be instantiated directly"));
qmlRegisterUncreatableType<VlcTrackModel>("VlcTrackModel", 1, 1, "VlcTrackModel", QStringLiteral("VlcTrackModel cannot be instantiated directly"));
qmlRegisterType<VlcQmlVideoOutput>("VlcVideoOutput", 1, 1, "VlcVideoOutput");
qmlRegisterType<VlcQmlPlayer>("VlcPlayer", 1, 1, "VlcPlayer");
To copy to clipboard, switch view to plain text mode
import VlcPlayer 1.1
import Vlc 1.1
import VlcVideoOutput 1.1
VlcVideoOutput {
source:
VlcPlayer {
id: vlcPlayer
url: "rtsp://184.72.239.149/vod/mp4:BigBuckBunny_175k.mov"
}
}
import VlcPlayer 1.1
import Vlc 1.1
import VlcVideoOutput 1.1
VlcVideoOutput {
source:
VlcPlayer {
id: vlcPlayer
url: "rtsp://184.72.239.149/vod/mp4:BigBuckBunny_175k.mov"
}
}
To copy to clipboard, switch view to plain text mode
I don't want to use the VlcQmlVideoPlayer as it is deprecated and besides, I only get audio and not video when using it.
Bookmarks