Hello everyone,
Thank you for the wonderful work everyone does here!
I'm trying to fix some issues I've encountered on two apps I'm developing (Radio Nova and UT Nextcloud Music) and that are already available on the store.
The first problem is audio playback at first launch. It is currently necessary to manually click on pause then play for the audio to actually launch. It's as if the player hadn't been properly initialized.
Here's an example of Main.qml code that reproduces this problem.
I don't have any problems with clickable desktop. Unfortunately, I can't test on my smartphone other than with a build because clickable doesn't work properly (issue 447 of clickable), so I don't have the execution logs on smartphone.
The second problem, perhaps linked to the system's audio management, is that the player does not skip to the next song if the application is not in focus.
In other words, everything's fine if the app is open on the screen, but if the player is put to sleep or another application is displayed, it doesn't skip to the next audio track.
If these problems are not related, I can open another topic.
Can you help me, please?
import QtQuick 2.9
import Lomiri.Components 1.3
import QtQuick.Layouts 1.3
import Qt.labs.settings 1.0
import QtMultimedia 5.12
import QtQuick.Controls 2.2
import QtQuick.Controls.Material 2.1
import QtQuick.Controls.Universal 2.1
import QtSystemInfo 5.5
import Ubuntu.Components 1.3 as Ubuntu
MainView {
id: root
objectName: 'mainView'
applicationName: 'audio.gwado'
automaticOrientation: true
width: units.gu(45)
height: units.gu(75)
Audio {
id: audioPlayer
source: "https://novazz.ice.infomaniak.ch/novazz-128.mp3"
}
Page {
anchors.fill: parent
header: PageHeader {
id: header
title: i18n.tr('audio')
}
Column {
anchors.centerIn: parent
Button {
id: playPauseButton
text: audioPlayer.playbackState === Audio.PlayingState ? i18n.tr("Pause") : i18n.tr("Play")
onClicked: {
if (audioPlayer.playbackState === Audio.PlayingState) {
audioPlayer.pause()
} else {
audioPlayer.play()
}
}
}
}
}
}
The imported libraries are certainly too numerous, contrary to my development skills.