Rock Mobile Docs

Please login to access all of the features of the Community Site.

PlayAudio

Mobile1.0

Like the PlayVideo command, this initiates a full-screen playback of an audio file. Given that it's audio, there won't be much to see.

The CommandParameter consists of a string that contains the URL of the audio file to be played.

Note

Starting in Mobile2.0 you can also pass in a PlayAudioParameters object which contains the following properties.

Note

The audio URL must use HTTPS. Otherwise the app shows an "Insecure Source Detected" alert instead of playing it.

Properties

PropertyTypeDescription
ThumbnailSourcestringThe URL that contains the image to displayed as the thumbnail of the media player. This overrides any embedded artwork found in the metadata.
(See PlayVideoParameters for more properties)

Examples

<Button Text="Tap"
    Command="{Binding PlayAudio}"
    CommandParameter="http://www.noiseaddicts.com/samples_1w72b820/2541.mp3" />
<Button Text="Tap"
    Command="{Binding PlayAudio}">
    <Button.CommandParameter>
        <Rock:PlayAudioParameters Source="http://www.noiseaddicts.com/samples_1w72b820/2541.mp3"
            ThumbnailSource="https://upload.wikimedia.org/wikipedia/commons/c/c5/Big_buck_bunny_poster_big.jpg" />
    </Button.CommandParameter>
</Button>