apache / cordova-ios

Apache Cordova iOS
https://cordova.apache.org/
Apache License 2.0
2.15k stars 987 forks source link

Media plugin not working after Cordova and Cordova iOS platform upgrades #1101

Open develobert opened 3 years ago

develobert commented 3 years ago

Problem

Cordova app (jQuery + jQuery mobile) working fine using Cordova 8.1.2 and Cordova iOS 4.5.1. After upgrading Cordova to 10.0.0 and Cordova iOS platform to 6.2.0, I get the following error when creating a Media instance: ReferenceError: Can't find variable Media

What is expected to happen?

var my_media = new Media(url);
   my_media.play();

That should play audio file (mp3) found at url (external URL in my case). This works fine with Cordova Android 9.1.0.

What does actually happen?

The line var my_media = new Media(url); gives error ReferenceError: Can't find variable Media when debugging via Xcode (in simulator with iOS version 14.4 and in device with iOS 12.x and 14.x).

Information

Nothing has changed in the code of the app, only the platform upgrades mentioned above.

Command or Code

var my_media = new Media(url);

Environment, Platform, Device

iPhone 12 iOS 14.4 iPhone XS Max iOS 14.4 iPhone 5s 12.x

Version information

Cordova 10.0.0 Cordova iOS 6.2.0 Xcode 12.4

Checklist