UBports Robot Logo UBports Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login
    1. Home
    2. gwado
    3. Best
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 4
    • Posts 11
    • Groups 0

    Posts

    Recent Best Controversial
    • RE: Problem initializing audio player for automatic playback on launch

      @CiberSheep Thank you for sharing this code with me.
      I've noticed that the problem seems to exist for this app too, as the developer uses a timer to start playback with a delay.
      I applied this in my code and it seems to work. I'll now be able to add a few features to it.
      Thanks again.

      Here's a code snippet if it helps anyone in the future. Timer interval (1500ms) to be adapted.

          Timer {
              id: playStarter
              interval: 1500
              onTriggered: {
                  musicPlayer.play()
              }
          }
          MediaPlayer {
              id: musicPlayer
          }
      
          function pause() {
              musicPlayer.pause();
          }
      
          function play() {
              if (musicPlayer.source) {
                  musicPlayer.pause();
                  playStarter.restart();
              }
          }
      
      
      
      posted in App Development
      gwadoG
      gwado
    • RE: Problem initializing audio player for automatic playback on launch

      @CiberSheep Thank you. I was using mediaplayer but the problem was the same. I'll dig up the subject again and go over the code. As my request is basic, the problem is certainly in my approach and my code.
      I will be back.

      posted in App Development
      gwadoG
      gwado