Backstory here! Skip through next paragraph to get to View
implementation.
这里的背景! 跳过下一段,以View
实现。
Last week I have finished Waracle’s Digital Academy — quick SwiftUI course run by Laurie Aviel Gray (Code Disciple). The technology is great for use in personal projects and I can’t wait until it will be more commonly adapted, because the ease of use and uniformity of projects is just amazing. During the course I was working on using it for my own project — an app companion for Chrome Extension: Watch Next: YouTube, which work with user created playlists. For it to work I needed a SwiftUI version of the YouTube player, but none was ready yet: YouTube’s own implementation is written in Objective-C and the implementation which allows the use of native iOS media player was no longer maintained (plus is breaking YouTube’s licensing), so I have decided to use the very recent (updated this month for WKWebView
) implementation YouTube Player from Giles Van Gruisen and wrap it as a UIViewRepresentable
myself.
上周,我完成了Waracle的数字学院-由Laurie Aviel Gray ( Code Disciple )开设的快速SwiftUI课程。 该技术非常适合在个人项目中使用,我迫不及待要对其进行更广泛的修改,因为项目的易用性和统一性令人惊叹。 在课程中,我一直在为自己的项目使用它-Chrome扩展程序的应用程序伴侣: 观看下一个:YouTube ,它可以与用户创建的播放列表一起使用。 为了使其正常工作,我需要一个SwiftUI版本的YouTube播放器,但尚未准备好: YouTube自己的实现是用Objective-C编写的,不再允许使用本机iOS媒体播放器的实现(而且破坏了YouTube的实现)许可),因此我决定使用Giles Van Gruisen的最新实现(本月为WKWebView
更新), WKWebView
YouTube Player 自身包装为UIViewRepresentable
。
With the way SwiftUI works, this task will require a wrapper