Hi I'm developing an Hybrid Application in Cordova. I would like to reproduce an audio from the application. I obtained error using:
- Audio Tag inside html
- Audio javascript object
- Ionic NativeAudio
I also tried to download file and to reproduce it but when I can download I can only on some folder, to reproduce file only other folder.
EDIT some code: where if I open the url from chrome or firefox or VLC I can hear correctly the sound Il browser non supporta l'audio
Javascript code: and url is the same of above
this.stream = new Audio(url);
this.stream.addEventListener('playing', (data) => {
console.log(data);
});
this.stream.addEventListener('error', (error) => {
console.log(error);
});
this.stream.play();
In console I obtain:
Event {isTrusted: true, type: "playing", target: audio, currentTarget: audio, eventPhase: 2…}bubbles: falsecancelBubble: falsecancelable: truecurrentTarget: nulldefaultPrevented: falseeventPhase: 0isTrusted: trueisTrusted: truepath: Array[1]returnValue: truesrcElement: nulltarget: nulltimeStamp: 5007452.3950000005type: "playing"__proto__: Event
francesca-player.ts:35
Event {isTrusted: true, type: "error", target: audio, currentTarget: audio, eventPhase: 2…}bubbles: falsecancelBubble: falsecancelable: truecurrentTarget: nulldefaultPrevented: falseeventPhase: 0isTrusted: trueisTrusted: truepath: Array[1]returnValue: truesrcElement: nulltarget: nulltimeStamp: 5008322.655000001type: "error"__proto__: EventAT_TARGET: 2BLUR: 8192BUBBLING_PHASE: 3CAPTURING_PHASE: 1CHANGE: 32768CLICK: 64DBLCLICK: 128DRAGDROP: 2048FOCUS: 4096KEYDOWN: 256KEYPRESS: 1024KEYUP: 512MOUSEDOWN: 1MOUSEDRAG: 32MOUSEMOVE: 16MOUSEOUT: 8MOUSEOVER: 4MOUSEUP: 2NONE: 0SELECT: 16384bubbles: (...)get bubbles: ()cancelBubble: (...)get cancelBubble: ()set cancelBubble: ()cancelable: (...)get cancelable: ()constructor: Event()currentTarget: (...)get currentTarget: ()defaultPrevented: (...)get defaultPrevented: ()eventPhase: (...)get eventPhase: ()initEvent: initEvent()path: (...)get path: ()preventDefault: preventDefault()returnValue: (...)get returnValue: ()set returnValue: ()srcElement: (...)get srcElement: ()stopImmediatePropagation: stopImmediatePropagation()stopPropagation: stopPropagation()target: (...)get target: ()timeStamp: (...)get timeStamp: ()type: (...)get type: ()Symbol(Symbol.toStringTag): "Event"__proto__: Object
Someone can help me? Daniele