1

While playing audio, is it possible to add in extra view or layout e.g, dialog,text or some picture when you playing audio, and change when navigating audio from one to another. As i see from my simulator(don't have a real device), it's too empty

enter image description here

I am quite blur on how to add thing in between audio as the format is quite restricted in audioPlayer.

Anyway is it possible? Or is the blank is filled when playing audioPlayer from real device?

Thanks.

talatan
  • 41
  • 1
  • 7

1 Answers1

2

Yes, you have full control to render a custom display when you're showing a result-view and playing the audio player. You can see an example of this when using the podcast-template that's built into Bixby Studio. In that template, this is the result view (see using match patterns).

result-view {
  match {
    Result {
      from-output {
        _ {
          from-input {
            audioPlayer.AudioInfo (audioInfo) {
              min (Required) max (One)
            }
          }
        }
      }
    }
  }

  message {
    template-macro (podcast-result) {
      param (audioInfo) {
        expression (audioInfo)
      }
    }
  }

  render {
    layout {
      section {
        content {
          image {
            url ("[#{value(audioInfo.audioItem[audioInfo.startAudioItemIndex].albumArtUrl)}]")
            object-fit (Contain)
            aspect-ratio (1:1)
            lightbox-enabled (false)
          }
        }
      }
    }
  }
}
Pete Haas
  • 1,800
  • 1
  • 12
  • 15
  • 2
    Thanks, Pete, helpful as always. Bixby will render the result-view matching the output concept type of PlayAudio action. The info about audio such as title, author, should be displayed on IDE simulator and on-device if filled correctly. You can download and try this sample capsule https://github.com/bixbydevelopers/capsule-samples-collection/tree/master/audio – BixbyDevSupport-Tokonyan Mar 30 '20 at 16:47