在 WatchOS 2 中从 URL 播放视频 [英] Play Video From URL in WatchOS 2

查看:32
本文介绍了在 WatchOS 2 中从 URL 播放视频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

So recently Apple® released the second operating system for their Apple Watch®. With this update, Apple Watch® can now have HTTP requests and internet connection by itself. They added the

 WKInterfaceMovie

使用该方法从 url 加载视频

Which loads a video from a url with the method

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

" - setMovieURL: Declaration (New in watchOS 2.0)

快速

  func setMovieURL(_ URL: NSURL)

目标-C

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

"

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

If I input a URL with any .mov video online. The WKInterfaceMovie closes automatically. Sometimes the "Downloading" circle comes and begins to load up but I haven't been able to show up the remote video (Not stored in the Apple Watch®)

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

I would be amazed if someone can help me.

谢谢

推荐答案

它仅适用于 https URL,而不管应用传输安全 (ATS) 设置如何.

It only works with https URLs, regardless of the App Transport Security (ATS) settings.

来源 WatchKit 框架参考:

如果您为远程服务器上的文件指定 URL,则此方法首先下载文件并显示一个进度指示器,显示操作的进度.由于 WatchKit 在从 Web 服务器下载文件时使用 App Transport Security (ATS),因此文件必须位于安全服务器上,并且 URL 必须使用 https 方案.如果您的服务器不支持 ATS 级别的安全性,请在播放前自行下载文件.

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.

这篇关于在 WatchOS 2 中从 URL 播放视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆