ios - 在 WatchOS 2 中从 URL 播放视频

标签 ios xcode video apple-watch watchos-2

最近 Apple® 为其 Apple Watch® 发布了第二个操作系统。通过此更新,Apple Watch® 现在可以自行拥有 HTTP 请求和互联网连接。他们添加了

 WKInterfaceMovie

使用方法从 url 加载视频

" - 设置电影网址: 声明(watchOS 2.0新增)

迅捷

  func setMovieURL(_ URL: NSURL)

objective-C

- (void)setMovieURL:(NSURL * _Nonnull)URL

如果我在线输入带有任何 .mov 视频的 URL。 WKInterfaceMovie 自动关闭。有时“正在下载”圆圈出现并开始加载,但我无法显示远程视频(未存储在 Apple Watch® 中)

如果有人能帮助我,我会很惊讶。

谢谢

最佳答案

无论应用传输安全 (ATS) 设置如何,它仅适用于 https URL

来源WatchKit Framework Reference :

If you specify a URL for a file on a remote server, this method downloads the file first and displays a progress indicator showing the progress of the operation. Because WatchKit uses App Transport Security (ATS) when downloading files from a web server, the file must be on a secure server, and the URL must use the https scheme. If your server does not support ATS–level security, download the file yourself before playing it.

关于ios - 在 WatchOS 2 中从 URL 播放视频,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31643946/

相关文章:

android - 小米滑板车通信代码

ios - 目录应用程序和应用程序批准规则

xcode - 无法在 bundle base 国际化中加载 nib

c# - 使用 emgucv 2.1.0.0 加载视频文件

ios - 未识别的 Segue

ios - 如何在成员之间保持链接的同时访问 NSDictionary 的另一个成员中的成员

ios - 有没有办法在构建之前下载配置文件(使用 Jenkins 或脚本)来构建机器?

javascript - HTML 5 视频 : Playing multiple "clips" with javascript

iphone - 仅通过 iOS 应用程序访问视频内容——我该怎么做

ios - 是否可以使用 Phonegap 在 iOS 上实现视频自动播放?