Skip to content

Instantly share code, notes, and snippets.

@agungf
Created February 27, 2017 12:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save agungf/3a35d0d15a574ebb81af520e970dbb12 to your computer and use it in GitHub Desktop.
Save agungf/3a35d0d15a574ebb81af520e970dbb12 to your computer and use it in GitHub Desktop.
Dacast player code snipper from IOS App
@IBOutlet weak var videoWebView: UIWebView!
videoWebView.allowsInlineMediaPlayback = false
videoWebView.mediaPlaybackRequiresUserAction = true
videoWebView.scrollView.scrollEnabled = false
let videoURLString = String(format:"%@/%@?file_id=%@&ip=%@&ua=%@", RGConstant.Services.URL.videoBaseURL, RGConstant.Services.URL.Path.videoPlayer, fileIDVideo, ipAdress,userAgent)
let videoURL = NSURL(string: videoURLString)
let request = NSMutableURLRequest(URL: videoURL!)
if let token = TokenManager.sharedManager.getToken() {
request.setValue(String(format: "Bearer %@", token), forHTTPHeaderField:"Authorization")
}
videoWebView.loadRequest(request)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment