I am new to Swift and video streaming. I am trying to play videos in AppleTV. Did some one try to add subtitles with AVPlayerViewController in swift from an external srt file. I am trying to do the same using code from here: https://github.com/mhergon/MPMoviePlayerController-Subtitles.
I changed the code to suit my requirements, but it is throwing an exception:
NSInvalidArgumentException', reason: 'Unable to parse constraint format: Unable to interpret '|' character, because the related view doesn't have a superview H:|-(20)-[l]-(20)-|
At this point in the Subtitles.swift file:
var constraints = NSLayoutConstraint.constraintsWithVisualFormat("H:|-(20)-[l]-(20)-|", options: NSLayoutFormatOptions(rawValue: 0), metrics: nil, views: ["l" : subtitleLabel!])
subtitleContainer?.addConstraints(constraints)