You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2022/02/02 09:16:41 UTC

[GitHub] [cordova-plugin-media] anonymze opened a new issue #330: Ionic Capacitor iOs: Media create INVALID (https url)

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: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [cordova-plugin-media] anonymze edited a comment on issue #330: Ionic Capacitor iOs: Media create INVALID (https url)

Posted by GitBox <gi...@apache.org>.
anonymze edited a comment on issue #330:
URL: https://github.com/apache/cordova-plugin-media/issues/330#issuecomment-1029134707


   The issue seems related to this one: #324 
   But the fix didn't work for me. I added this in CDVSound.m (line 398):
   
   ```
    if (audioFile.rate != nil){
                          float customRate = [audioFile.rate floatValue];
                          NSLog(@"Playing stream with AVPlayer & custom rate");
                          [avPlayer setRate:customRate];
    } else {
                         NSLog(@"Playing stream with AVPlayer & default rate");
                         avPlayer.automaticallyWaitsToMinimizeStalling = true;
                         [avPlayer play];
    }
   ```


-- 
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: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [cordova-plugin-media] anonymze commented on issue #330: Ionic Capacitor iOs: Media create INVALID (https url)

Posted by GitBox <gi...@apache.org>.
anonymze commented on issue #330:
URL: https://github.com/apache/cordova-plugin-media/issues/330#issuecomment-1046824721


   
   
   
   
   > > There is my url where i get the audio file: http://viny.openstudio-lab.com/post/file/d45b1000-289f-4f5e-9a3d-c888332d78cd
   > 
   > Please note that this is **not** an http**s** URL. Might matter, might not.
   
   Hello,
   
   Same result with a https URL.


-- 
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: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [cordova-plugin-media] anonymze commented on issue #330: Ionic Capacitor iOs: Media create INVALID (https url)

Posted by GitBox <gi...@apache.org>.
anonymze commented on issue #330:
URL: https://github.com/apache/cordova-plugin-media/issues/330#issuecomment-1050781413


   Hello,
   
   Yes sorry, i completely forgot.
   There is an accessible URL: https://api.viny.club/post/file/47678658-88ab-4f6e-97f1-31d65b4cf152
   
   


-- 
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: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [cordova-plugin-media] bikubi commented on issue #330: Ionic Capacitor iOs: Media create INVALID (https url)

Posted by GitBox <gi...@apache.org>.
bikubi commented on issue #330:
URL: https://github.com/apache/cordova-plugin-media/issues/330#issuecomment-1046844270


   I assume you switch BasicAuth on/off for testing, or use an IP-based filter? I only get 401 for both http and https.


-- 
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: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [cordova-plugin-media] anonymze commented on issue #330: Ionic Capacitor iOs: Media create INVALID (https url)

Posted by GitBox <gi...@apache.org>.
anonymze commented on issue #330:
URL: https://github.com/apache/cordova-plugin-media/issues/330#issuecomment-1029134707


   The issue seems related to this issue: #324 
   But the fix didn't work for me. I added this in CDVSound.m (line 398):
   
   ```
    if (audioFile.rate != nil){
                           float customRate = [audioFile.rate floatValue];
                           NSLog(@"Playing stream with AVPlayer & custom rate");
                           [avPlayer setRate:customRate];
    } else {
                         NSLog(@"Playing stream with AVPlayer & default rate");
                         avPlayer.automaticallyWaitsToMinimizeStalling = true;
                         [avPlayer play];
    }
   ```


-- 
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: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [cordova-plugin-media] bikubi commented on issue #330: Ionic Capacitor iOs: Media create INVALID (https url)

Posted by GitBox <gi...@apache.org>.
bikubi commented on issue #330:
URL: https://github.com/apache/cordova-plugin-media/issues/330#issuecomment-1039277470


   > There is my url where i get the audio file: http://viny.openstudio-lab.com/post/file/d45b1000-289f-4f5e-9a3d-c888332d78cd
   
   Please note that this is **not** an http**s** URL. Might matter, might not.


-- 
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: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [cordova-plugin-media] anonymze edited a comment on issue #330: Ionic Capacitor iOs: Media create INVALID (https url)

Posted by GitBox <gi...@apache.org>.
anonymze edited a comment on issue #330:
URL: https://github.com/apache/cordova-plugin-media/issues/330#issuecomment-1029134707


   The issue seems related to this one: #324 
   But the fix didn't work for me. I added this in CDVSound.m (line 398):
   
   ```
    if (audioFile.rate != nil){
                          float customRate = [audioFile.rate floatValue];
                          NSLog(@"Playing stream with AVPlayer & custom rate");
                          [avPlayer setRate:customRate];
    } else {
                         NSLog(@"Playing stream with AVPlayer & default rate");
                         avPlayer.automaticallyWaitsToMinimizeStalling = true; // i added this line !
                         [avPlayer play];
    }
   ```


-- 
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: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [cordova-plugin-media] bikubi commented on issue #330: Ionic Capacitor iOs: Media create INVALID (https url)

Posted by GitBox <gi...@apache.org>.
bikubi commented on issue #330:
URL: https://github.com/apache/cordova-plugin-media/issues/330#issuecomment-1039277470


   > There is my url where i get the audio file: http://viny.openstudio-lab.com/post/file/d45b1000-289f-4f5e-9a3d-c888332d78cd
   
   Please note that this is **not** an http**s** URL. Might matter, might not.


-- 
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: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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