Skip to main content

Native Apple

There are two easy ways to get started with Vindral on native Apple (iOS, iPadOS, AppleTV) applications:

Integrate Vindral via the Vindral Apple SDK

With support for 4K, picture-in-picture, and fast channel switching, the Vindral Apple SDK is a great way to consume high-quality, low-latency streams within a native Apple device.

Read the Vindral Apple SDK API Reference for more information on how to implement native playback.

Integrate Vindral via Webview

The easiest way to view Vindral streams on native iOS and iPadOS applications is to embed the hosted player with a WebView. No custom interface is needed, and the code below is all that is required.

You can find a complete example project on GitHub.

// Bare minimum ViewController displaying a Vindral Stream

import UIKit
import WebKit

class ViewController: UIViewController {
var webView: WKWebView!

override func loadView() {
// Create a config for our view that allows audio/video
let config = WKWebViewConfiguration()
config.allowsInlineMediaPlayback = true
if #available(iOS 10.0, *) {
config.mediaTypesRequiringUserActionForPlayback = []
} else {
config.mediaPlaybackRequiresUserAction = false
}

// Initialize WKWebView with config
self.webView = WKWebView(frame: .zero, configuration: config)
self.view = webView
}

override func viewDidLoad() {
super.viewDidLoad()
let url = URL(string: "https://embed.vindral.com/?channelId=vindral_demo1_ci_099ee1fa-80f3-455e-aa23-3d184e93e04f")!
let request = URLRequest(url: url)
self.webView.load(request)
}
}

Creating your custom web player using the Web SDK and displaying it via WebView is also possible.