You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2019/04/04 00:27:01 UTC

[GitHub] [cordova-plugin-media] leaditnet opened a new issue #221: after using the plugin youtube cannot play videos on IOS 11 and 12

leaditnet opened a new issue #221: after using the plugin youtube cannot play videos on IOS 11 and 12
URL: https://github.com/apache/cordova-plugin-media/issues/221
 
 
   My App uses Ionic-native-media to record audio then play back, after this happens, youtube cannot play videos inside in-app-browser
   
   ### What is expected to happen?
   Plugin should not affect youtube video playing
   
   ### What does actually happen?
   After plugin is called for audio recording, youtube cannot play video inside in-app-browser
   
   ## Information
   Ios 11 or 12
   Ionic 2 , Ionic-native 4, ionic native media plugin.
   record audio using media plugin
   play back the audio
   open a youtube page inside in-app-browser
   video does not play
   
   
   
   ### Command or Code
   ```
   startrecord(){
   try{
     this.filename = this.filename.replace(".wav",Number(new Date()).toString()+".wav");
     this.recordStatus =1;
     //IOS
     this.file.createFile(this.file.tempDirectory, this.filename, true).then(() => {
       this.file.checkFile(this.file.tempDirectory,this.filename).then(()=>{
       this.mfile  = this.media.create(this.file.tempDirectory.replace(/^file:\/\//, '') + this.filename);
       this.mfile.startRecord();
     },()=>{alert('File does not exist' + this.dir+this.filename);
     
   });
     });
   
   }catch(e){alert('error2:'+e);}
   }
   
   stoprecord(){
   try{
     //
     this.mfile.stopRecord();
     this.mfile.release();
     this.recordStatus =2 ;
      this.file.checkFile(this.file.tempDirectory,this.filename).then(()=>{ //alert('exists');
       },()=>{
       this.file.resolveLocalFilesystemUrl(this.file.tempDirectory+this.filename)
       .then(r => {
         try{this.playback(r)}catch(e){console.log(JSON.stringify(e));}}
         )
       .catch(e => alert('error1:'+JSON.stringify(e)));
     
   }catch(e){alert('error:'+ JSON.stringify(e));} 
   }
   
   playback(r){
         this.play(r.nativeURL.replace(/^file:\/\//, ''));
       }
   
   
   play(url)
   {
     
     this.myaudio = new Audio(url);
     var readyStateInterval = null;
     if(this.myaudio !=null && this.myaudio.paused)
         {
           this.myaudio.play();
           
           return;}
     readyStateInterval = setInterval(function(this){
         if (this.readyState <= 2) {
         this.playstatus=this.readyState;
         }
      },1000);
      
   openlink(){
           const browser = this.iab.create('https://www.youtube.com/watch?v=C0DPdy98e4c','_blank');
         
     }
   }
   ```
   
   
   ### Environment, Platform, Device
   Ios 11 or 12
   Ionic:
   
      ionic (Ionic CLI)  : 4.5.0 (C:\Users\admin\AppData\Roaming\npm\node_modules\ionic)
      Ionic Framework    : ionic-angular 3.9.2
      @ionic/app-scripts : 3.1.5
   
   Cordova:
   
      cordova (Cordova CLI) : not installed
      Cordova Platforms     : android 6.3.0, browser 5.0.4, ios 4.5.4
      Cordova Plugins       : cordova-plugin-ionic-webview 1.1.1, (and 16 other plugins)
   
   System:
   
      NodeJS : v10.13.0 (C:\Program Files\nodejs\node.exe)
      npm    : 6.5.0
      OS     : Windows 10
   
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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