title: How to play videos on CarPlay?
body: <p>I have a web link to a video, in iOS I can open it with AVFoundation/AVKit frameworks inside AVPlayerViewController/AVPlayer. </p>
  
  <p>But how can I open it in CarPlay?</p>
  
  <p>Text from CarPlay documentation: </p>
  
  <blockquote>
    <p>You cannot play video media items directly using the Media Player
    framework. To play back videos containing MPMediaItem objects, use an
    AVPlayer object from AVFoundation. The system player also provides a
    way to play video items using the system apps.</p>
  </blockquote>
  
  <pre><code>extension AppDelegate: CPListTemplateDelegate {
      func listTemplate(_ listTemplate: CPListTemplate, didSelect item: CPListItem, completionHandler: @escaping () -&gt; Void) {
          if let url = item.userInfo as? String {
              self.playVideo(url)
          }
      }
  }
  </code></pre>