Play Video From URL in WatchOS 2

半腔热情 提交于 2019-12-06 10:13:20

问题


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

Which loads a video from a url with the method

" - setMovieURL: Declaration (New in watchOS 2.0)

SWIFT

  func setMovieURL(_ URL: NSURL)

OBJECTIVE-C

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

"

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.

Thanks


回答1:


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

Source 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.



来源:https://stackoverflow.com/questions/31643946/play-video-from-url-in-watchos-2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!