With the QML Multimedia components, Felgo offer a rich set to use multimedia in your apps.
import Felgo import QtQuick import QtMultimedia App { NavigationStack { AppPage { title: "Audio" Column { anchors.centerIn: parent AppButton { anchors.horizontalCenter: parent.horizontalCenter text: "Play Audio" onClicked: { audio.play() } } } MediaPlayer { id: audio audioOutput: AudioOutput {} source: "https://felgo.com/web-assets/beep.mp3" } } } }
Displaying a video in your app is just as easy as playing audio. As you can see in both the audio and video example, we use a web url for the media asset. The multimedia components are capable of playing multimedia assets bundled with the app, online or even streaming media.
import Felgo import QtQuick import QtMultimedia App { // Displays a title bar and is used for navigation between pages NavigationStack { AppPage { title: "Video" // Is displayed in the title bar MediaPlayer { id: mediaplayer videoOutput: output loops: MediaPlayer.Infinite source: "https://felgo.com/web-assets/video.mp4" } VideoOutput { id: output anchors.fill: parent } } } Component.onCompleted: mediaplayer.play() }
The YouTubeWebPlayer component offers a QML API to configure and control an embedded YouTube Iframe-Player. It is sufficient to configure the videoId
property of the
player. To immediately start playpack, set autoplay
to true
:
import Felgo App { NavigationStack { AppPage { title: "YouTube Player" YouTubeWebPlayer { videoId: "BiO5BVJklxQ" autoplay: true } } } }
As part of the free Business evaluation, we offer a free welcome call for companies, to talk about your requirements, and how the Felgo SDK & Services can help you. Just sign up and schedule your call.
Sign up now to start your free Business evaluation: