cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "julian hill (JIRA)" <j...@apache.org>
Subject [jira] [Created] (CB-11941) Allow windows and windows phone apps to play audio located relative to the app root
Date Sun, 02 Oct 2016 09:16:21 GMT
julian hill created CB-11941:
--------------------------------

             Summary: Allow windows and windows phone apps to play audio located relative
to the app root
                 Key: CB-11941
                 URL: https://issues.apache.org/jira/browse/CB-11941
             Project: Apache Cordova
          Issue Type: Improvement
          Components: Plugin Media
    Affects Versions: 2.4.0
         Environment: windows and windows phone
            Reporter: julian hill
            Priority: Minor


I've had a look at the plugin code for windows and for the media source it looks like you
can specify a url, a 'file://' or a 'cdvFile://'.

The problem with the latter two is that they have to refer to either temp or persistent storage;
it's not possible to specify that you want the audio file retrieving from a folder relative
to the app root.

I've manually copied over my audio files to:
...\AppData\Local\Packages\my_app_name\LocalState

...and confirmed that they do play if I specify a path of: ''cdvfile://localhost/persistent/my_audio.mp3''

I've overriden the src/windows/MediaProxy.js code and hardcoded in various different paths
for "thisM.node.src = srcUri.absoluteCanonicalUri;"

I've tried: 
thisM.node.src = "ms-appx:///audio/my_audio_file.mp3"
thisM.node.src = "ms-appx:///my_app_name/www/audio/my_audio_file.mp3"
thisM.node.src = "audio/my_audio_file.mp3"

The first two don't report any errors when trying to play but nothing is heard.
The last one converts the source to:
"ms-appx-web://my_app_name/www//audio/my_audio_file.mp3"
... and reports an invalid src error when attempting to play.

So, it looks like something in the C# code also need changing.

As a work around I'll have to (if possible) check if the media files exist in the persistent
folder and if not copy them over from the app audio folder.

Alternatively I could install the media files into the persistent folder when the app is installed
but I haven't found a way to do this yet.

Thanks






--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Mime
View raw message