Latest 0.1.4
License MIT
Platforms ios 9.0, requires ARC
Frameworks WebKit

This is a simple drop in WKWebView for embedded videos from YouTube and vimeo.


  • Provide a text and get back a WKWebView
  • Check if text has links
  • Return string without links
  • Resize WebView
    screen shot 2017-09-21 at 1 47 28 pm
    screen shot 2017-09-21 at 1 48 26 pm


  • iOS 9.0
  • Swift 3.2
  • Xcode 9



To integrate this into your Xcode project using CocoaPods, add it to your Podfile:

pod 'TRVideoView'

Then, run the following command:

$ pod install


// Initialize  
let video = TRVideoView(text: "This is some sample text with a YouTube link")  

// Set the frame as always
video.frame = CGRect(x: 0, y: 0, width: 300, height: 150)

// Returns true or false (checks for YouTube and Vimeo urls)

// Returns String with out URLs (i.e. "This is some sample text with a YouTube link")
let text = video.textWithoutURLs()

// Finally add it to your view

Notes on links

For YouTube either or works.
For Vimeo use
If other parameters are also included in the link it does not matter, they are sorted out.


Want to see other video services supported? You can open an issue and I will see what I can do.
If you would like to fork this project and add more features, go ahead and make a PR, I’m happy about your contributions.

Latest podspec

    "name": "TRVideoView",
    "platforms": {
        "ios": "9.0"
    "summary": "TRVideoView is a simple drop in WebView for embedded YouTube and Vimeo videos.",
    "requires_arc": true,
    "version": "0.1.4",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    "authors": {
        "Tim Roesner": "[email protected]"
    "homepage": "",
    "source": {
        "git": "",
        "tag": "0.1.4"
    "frameworks": "WebKit",
    "source_files": "TRVideoView/**/*.{swift}",
    "pushed_with_swift_version": "3.2"

Pin It on Pinterest

Share This