Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mzafers/QtVlcMediaPlayer
LibVLC integrated Qt QML MediaPlayer for Android
https://github.com/mzafers/QtVlcMediaPlayer
Last synced: 3 months ago
JSON representation
LibVLC integrated Qt QML MediaPlayer for Android
- Host: GitHub
- URL: https://github.com/mzafers/QtVlcMediaPlayer
- Owner: mzafers
- Created: 2015-06-17T04:43:40.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-12-28T05:44:22.000Z (almost 8 years ago)
- Last Synced: 2024-06-16T03:35:51.530Z (5 months ago)
- Language: Java
- Homepage:
- Size: 19.2 MB
- Stars: 29
- Watchers: 2
- Forks: 8
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-qt-qml - QtVlcMediaPlayer - LibVLC integrated Qt QML MediaPlayer for Android. (Android)
README
It's easy to use. There are 4 steps.
Step 1. Just copy modified QtMultimedia.jar and QtMultimedia-bundled.jar files into your C:\Qt\5.7\android_armv7\jar and/or C:\Qt\5.7\android_x86\jar directory. If you did this before go to next step.
Step 2. Copy libvlcjni.so file into your project directory.
Step 3. Add these lines to your .pro file
```
QT += multimediacontains(ANDROID_TARGET_ARCH,armeabi-v7a) {
ANDROID_EXTRA_LIBS = \
$$PWD/libvlcjni.so
}
```
Step 4. You must call encodeUrlForAndroid function. Otherwise you use default Android MediaPlayer class. So, QML file seems like this:
```
import QtQuick 2.7
import QtQuick.Controls 1.4
import QtQuick.Window 2.2
import QtQuick.Dialogs 1.2
import QtMultimedia 5.6ApplicationWindow {
title: qsTr("Hello World")
width: 640
height: 480
visible: true
function encodeUrlForAndroid(Source)
{
if(Qt.platform.os !== "android")
return Source;// replace http to rtsp:
if(Source.substring(0,7) === "http://")
{
Source = Source.substring(7);
Source = "rtsp://" + Source + "???replaceRtspToHttp";
}// add vlc:
Source = Source + "???vlc";return Source;
}MediaPlayer{
id: vlcMediaPlayer
source: encodeUrlForAndroid("rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov")
autoPlay: true
}
VideoOutput{
source: vlcMediaPlayer
anchors.fill: parent
fillMode: VideoOutput.Stretch
}
}
```