web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Dynamic Audio Media no...
Power Apps
Unanswered

Dynamic Audio Media not working

(0) ShareShare
ReportReport
Posted on by

Hi all,

 

so, I've got this scenario

 

I've embedded some mp3's into the App as media.

 

The infomation regarding the mp3's is being pulled from a SQL table into a collection, which includes the filename of the mp3's embedded into the app.

 

ClearCollect(podcastList,SortByColumns(Filter('[dbo].[t_podcasts]',live=1),"dateloaded",Descending))

 

This is then displayed in a gallery with a click through action of:

 

Set(selectedProcess, ThisItem);
Navigate(Screen3,ScreenTransition.UnCover)

 

In Screen3, I've an audio player and have set the Media as selectedProcess.filename -  I've also set up a text file with this as the value, to make sure I'm bringing the correct data through.

 

When I run it, I get my gallery, I click through and the correct filename is shown in the text box, but the media item won't play.  Now, I suspected that as the app wasn't actually referencing the mp3's when published, it wasn't including them in the download.  To test this, I added a hardcoded media item, which works, however, referencing the same mp3 dynamically doesn't.

 

So, I'm now a tad confused.  Firstly, I think I do need to force the app to publish with the mp3's embedded, even though they aren't used...how do I do that?  And secondly, why isn't the dynamic update of Media working?

 

Any help gratefully received!

Phil

 

 

 

 

 

Categories:
I have the same question (0)
  • Verified answer
    v-xida-msft Profile Picture
    on at

    Hi @Anonymous,

    Could you please show more details about the podcastList collection within your app?

    Could you please share a bit more about the result the selectedProcess.filename formula returned? Is it just the name of the sound file?

     

    I have made a test, and the issue is confirmed on my side.

    When you type the dynamic mp3 content (selectedProcess.filename) within the Media property of the Audio control, the Audio control would recognize the result the selectedProcess.filename formula returned as a text value rather than a media file (.mp3 media file).

    If you want to play the Audio with the dynamic mp3 content (on your side, it is selectedProcess.filename), I afraid that there is no way to achieve your needs in PowerApps currently.

     

    As an alternative solution, please take a try with the following workaround:9.JPG

     

    10.JPG

    The Audio Media file within my app as below:11.JPG

    Set the OnVisible property of the first screen of my app to following formula:

     

    ClearCollect(podcastList,{filename:"SampleAudio1",Author:"Kris Dai"},{filename:"SampleAudio2",Author:"Teresa"})

    Set the Items property of the Gallery control to following:

    podcastList

    Set the OnSelect property of the Gallery control to following:

    Set(selectedProcess,ThisItem);Navigate(Screen2,ScreenTransition.Cover)

    Within the second screen, set the Media prperty of the Audio control to following formula:

    Switch(
    selectedProcess.filename,
    "SampleAudio1",SampleAudio1,
    "SampleAudio2",SampleAudio2
    )

    On your side, you should type the following formula:

    Switch(
    selectedProcess.filename,
    "SampleAudio1",SampleAudio1,
    "SampleAudio2",SampleAudio2,
    "SampleAudio3",SampleAudio3,
    ...
    "SampleAudioN",SampleAudioN
    )

    Note: The SampleAudio1, SampleAudio2, ... represents the file name of the MP3 media file embedded within your app.

     

     

    Best regards,

    Kris

  • Community Power Platform Member Profile Picture
    on at

    Hi, I can see hown this would work, however, it's not really dynamic as you would need to code in the names of each media item...unless there was a way of creating the statement dynamically and evaluating it somehow?

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard