Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-2382

Cannot play resource audio

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.4.0
    • 2.4.0
    • None

    Description

      The current implementation of Media playback is expecting the audio file to have been unpacked to Isolated Storage, which was the case on WP7 when this code was written.
      Currently it is not possible to play a file that is packaged as a resource.

      We need to implement reading the file from stream in order to address this.

      StreamResourceInfo fileResourceStreamInfo = Application.GetResourceStream(new Uri("www/sound1.wav", UriKind.Relative));
      SoundEffect soundEffect = SoundEffect.FromStream(fileResourceStreamInfo.Stream);
      soundEffect.Play();

      Attachments

        Activity

          People

            purplecabbage Jesse MacFadyen
            purplecabbage Jesse MacFadyen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: