كيفية بدء جناح الفيديو في MeeGo / Nokia N9 من كود كيو تي؟

StackOverflow https://stackoverflow.com/questions/9504413

  •  14-11-2019
  •  | 
  •  

سؤال

أواجه مشاكل في إطلاق مشغل فيديو Nokia الخاص بي من طلبي أنني لا أستطيع أن أكون قادرا على حلها.

محاولتي الأولى تضمنت الاتصال giveacodicetagpre.

من QML وهذا يبدو أن الخدعة على ما يرام، إلا أنه افتتح المستعرض في كل مرة واستخدامه بدلا من مجموعة الفيديو (اللاعب الأصلي).

next لقد حاولت cutetube-approadach حيث أبدأ عملية جديدة مثل هذا: giveacodicetagpre.

هذا يعمل، باستثناء أنه يتطلب إغلاق مجموعة الفيديو عند الاتصال بالشئين -> البداية، وإلا فإنه لم يفعل شيئا.

محاولتي الثالثة المعنية بدءا من جناح الفيديو عبر QDBus، لكن ذلك لم يعمل بشكل أفضل: giveacodicetagpre.

المشكلة مع هذا هو أنه يتطلب جناح الفيديو أن يكون قيد التشغيل والجري - المعلمة AutoStartService لم تساعد أيضا. إذا لم يكن Suite Video-Suite بالفعل، فإن المكالمة تفتحها على ما يرام ولكن، Alas، لا يوجد فيديو يبدأ اللعب.

في نهاية المطاف حاولت استخدام أيضا VideosuiteInterface ، ولكن حتى الحصول على برنامج تجميع البرنامج معه صعبا. عندما تمكنت في النهاية من ترجمة وربط جميع المكتبات ذات الصلة، فإن النتائج لم تختلف عن الخيار 3 أعلاه.

لذلك، هل هناك طريقة لاستخدامها إما VideosuiteInterface مباشرة أو عبر DBUS بحيث تبدأ تشغيل الفيديو بغض النظر عن الحالة الحالية للتطبيق؟

هل كانت مفيدة؟

المحلول

The solution was actually simpler than I really thought initially; the VideoSuiteInterface -approach worked after all. All it took was to use it properly. Here are the full sources should anyone want to try it themselves.

player.h:

#ifndef PLAYER_H
#define PLAYER_H
#include <QObject>
#include <maemo-meegotouch-interfaces/videosuiteinterface.h>

class Player : public QObject {
  Q_OBJECT
private:
  VideoSuiteInterface* videosuite;
public:
  Player(QObject *parent = 0);
  Q_INVOKABLE void play(QString url);
};
#endif // PLAYER_H

player.cpp:

#include "player.h"
#include <QObject>
#include <QStringList>
#include <QtDeclarative>

Player::Player(QObject *parent) : QObject(parent) {}

void Player::play(QString url) {
  QList<QVariant> args;
  QStringList urls;
  urls << url;
  args.append(urls);

  videosuite = new VideoSuiteInterface();
  videosuite->play(urls);
}

In addition you may want to connect some signals to make the UI more responsive, but basically that should do the trick.

Finally, you need to remember to add following to your .pro file and you are good to go:

CONFIG += videosuiteinterface-maemo-meegotouch
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top