anonymze opened a new issue #330:
URL: https://github.com/apache/cordova-plugin-media/issues/330


   Hello and thank you for your awesome work !
   
   # Bug Report
   
   ## Problem
   
   On iOs, the song is not playing and i got an error on the Xcode's console. I 
create my media with an https URL where i get my audio file (it can be a .mp3 
or a .wav file).
   
   ### What is expected to happen?
   
   It should be playing the song, it works like a charm on Android.
   
   ### What does actually happen?
   
   I got this error on the Xcode's console (i suppose it is related to why it's 
not working):
   
   To Native Cordova ->  Media release Media1406211762 ["options": 
[31e0d8f6-8bc9-bef4-c05c-029d1002b2f9]]
   To Native Cordova ->  Media create INVALID ["options": 
[ed2b3395-21d6-381f-0caf-070428409a48, 
http://viny.openstudio-lab.com/post/file/d45b1000-289f-4f5e-9a3d-c888332d78cd]]
   2022-02-02 10:04:29.064381+0100 App[35121:1018948] Will use resource 
'http://viny.openstudio-lab.com/post/file/d45b1000-289f-4f5e-9a3d-c888332d78cd' 
from the Internet.
   ⚡️  [log] - 
http://viny.openstudio-lab.com/post/file/d45b1000-289f-4f5e-9a3d-c888332d78cd
   To Native Cordova ->  Media startPlayingAudio INVALID ["options": 
[ed2b3395-21d6-381f-0caf-070428409a48, 
http://viny.openstudio-lab.com/post/file/d45b1000-289f-4f5e-9a3d-c888332d78cd, {
       playAudioWhenScreenIsLocked = 0;
   }]]
   
   ### Command or Code
   
   There is my url where i get the audio file: 
http://viny.openstudio-lab.com/post/file/d45b1000-289f-4f5e-9a3d-c888332d78cd
   
   My code:
   
   export class MediaService {
     file: MediaObject;
   
    constructor(...){}
     
     initMedia(fileId) {
       this.file = this.media.create(fileUrl);
   
       this.file.onStatusUpdate.subscribe((status) => {
          ...
       });
   
       this.playMedia();
     }
   
     playMedia(): void {
       if (this.file instanceof MediaObject) { // not necessary but for safety
         this.file.play({ playAudioWhenScreenIsLocked: false }); // i tried 
without the ios option too
       }
     }
   }
   
   ### Environment, Platform, Device
   
   Ionic + Capacitor / iOs / emulator iPhone on Xcode (tried on iPhone 11 and 
12).
   
   ### Version information
   
     "@ionic-native/media": "^5.36.0", // tried with the last version of 
awesome cordova same result
     "cordova-plugin-media": "^5.0.4"
    "@capacitor/core": "^3.2.5"
    "@capacitor/ios": "3.2.5"
   dev:
    "@angular/cli": "12.1.4"
     "@capacitor/cli": "^3.3.2",
   
   ## Checklist
   
   - [x ] I searched for existing GitHub issues
   - [x] I updated all Cordova tooling to most recent version
   - [x ] I included all the necessary information above
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to