Hello,
is-it possible to load an URI scheme on Android ?
package
{
import flash.display.Sprite;
import flash.events.Event;
import flash.events.IOErrorEvent;
import flash.media.Sound;
import flash.net.URLRequest;
public class Main extends Sprite
{
public function Main()
{
var uri:String = "content://com.android.externalstorage.documents/document/primary%3AMusic%2Fmysound.mp3";
var sound:Sound = new Sound();
sound.addEventListener(Event.COMPLETE, onSoundLoaded);
sound.addEventListener(IOErrorEvent.IO_ERROR, onSoundLoadError);
sound.load( new URLRequest( uri ) );
}
private function onSoundLoaded(event:Event):void
{
var sound:Sound = event.target as Sound;
sound.play();
}
private function onSoundLoadError(event:IOErrorEvent):void
{
trace(event.text);
}
}
}
I have this error :
Error #2032: Stream Error. URL: content://com.android.externalstorage.documents/document/primary%3AMusic%2Fmysound.mp3
I can get the file path using an ANE but Uri can lacks file scheme in some case
I get the URI scheme using a custom ANE, see here
Thanks