- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我写了一个 FireMonkey 应用程序(Delphi 10.1 Berlin),其中包括声音,通过 TMediaPlayer 播放的 mp3:
MediaPlayer1.FileName := TPath.Combine(TPath.GetDocumentsPath,'aSound.mp3');
MediaPlayer1.Play;
在 Windows 上运行良好。对于该应用程序的移动版本,我得到了帮助,以确定将来自 this link 的声音文件放在哪里。 :
Use the Project | Deployment menu item and select the Android and the iOS Device platforms and for each one click the "Add Files" button in the local toolbar to select the bitmap file to deploy with the app and set the Remote Path column value for each platform.
For Android, set the Remote Path to .\assets\internal
For iOS, set the Remote Path to StartUp\Documents
将文件添加到 \assets\internal
以进行 Android 部署也能正常工作——声音按预期播放。
我在 this SO question 的帮助下将应用程序加载到 ios 设备上.该应用程序运行良好——只是没有声音。其他应用程序仍然会发出声音,所以我知道问题不是 iPad。我尝试将 iOS 声音文件部署路径设置为 Startup\Documents\
和 StartUp\Documents
(Delphi 刚刚将其保存为 Startup\Documents。
我做错了什么?
最佳答案
iOS 在远程路径上区分大小写,你写的Startup\Documents\
必须是StartUp\Documents\
还始终包括一个检查以确保文件存在于 FileExists
中,如果找不到该文件,您的应用可以相应地处理它。
关于ios - 如何在 Delphi FireMonkey iOS 应用程序中存储和播放媒体文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48965151/
我是一名优秀的程序员,十分优秀!