Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to add network caching to qml-player #11

Open
ShettyRa opened this issue Jun 14, 2017 · 0 comments
Open

How to add network caching to qml-player #11

ShettyRa opened this issue Jun 14, 2017 · 0 comments

Comments

@ShettyRa
Copy link

I have successfully built and run QML Player.

I would like to set the network-caching option which is from the VlcMedia.

I have created a pointer of VlcMedia and want to call it in VlcVideoPlayer of (video.qml)

below is the code

main.cpp

#include <QtCore/QCoreApplication>
#include <QtGui/QGuiApplication>
#include <QtQuick/QQuickView>

#include <VLCQtCore/Common.h>
#include <VLCQtQml/QmlVideoPlayer.h>

#include <VLCQtCore/Media.h>

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");
    VlcQmlVideoPlayer::registerPlugin();

    QQuickView quickView;
    quickView.setSource(QUrl(QStringLiteral("qrc:/qml/video.qml")));    
    quickView.setResizeMode(QQuickView::SizeRootObjectToView);
    quickView.show();

    VlcMedia* media;
    media->setOption(QString(QStringLiteral("qrc:/qml/video.qml")));
    //media->setOption(":network-caching=200");

    return app.exec();
}

video.qml

import QtQuick 2.0
import VLCQt 1.0 
//import VLC-Qt_1.0.1_win64_msvc2013.include.VLCQtCore.Media 1.0

Rectangle {
    width: 640
    height: 480
    color: "black"

    VlcVideoPlayer {
        id: vidwidget
        anchors.fill: parent

        url: "rtsp://admin:[email protected]:554/cam/realmonitor?channel=1&subtype=0&unicast=true"
        String: ":network-caching=300"
    }
}

The build is sucessfull but there is a debug error

can someone tell me where am i going wrong

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant