OGeek|极客世界-中国程序员成长平台

标题: ios - 在 WatchOS 2 中从 URL 播放视频 [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-13 09:20
标题: ios - 在 WatchOS 2 中从 URL 播放视频

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

 WKInterfaceMovie

使用方法从 url 加载视频

" - 设置电影网址: 声明(watchOS 2.0 中的新功能)

swift

  func setMovieURL(_ URL: NSURL)

objective-C

- (void)setMovieURLNSURL * _Nonnull)URL

"

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

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

谢谢



Best Answer-推荐答案


它仅适用于 https 网址,与应用传输安全 (ATS) 设置无关。

来源 ptions:completion:" rel="noreferrer noopener nofollow">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/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://sqlite.in/) Powered by Discuz! X3.4