Skip to content
This repository has been archived by the owner on Dec 18, 2019. It is now read-only.

Commit

Permalink
fix URL resolution error
Browse files Browse the repository at this point in the history
  • Loading branch information
VeinGuo committed Jul 16, 2017
1 parent 085946b commit 0f420b4
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,10 @@ extension VGPlayerResourceLoaderManager: AVAssetResourceLoaderDelegate {
if let components = URLComponents(string: resourceURL.absoluteString) {
if let queryItem = components.queryItems {
let lastQueryItem = queryItem.last
originURL = URL(string: (lastQueryItem?.value)!)
let url = lastQueryItem?.value?.addingPercentEncoding(withAllowedCharacters:NSCharacterSet.urlFragmentAllowed)
originURL = URL(string: url!);
} else {
let url = components.query?.components(separatedBy: "=").last
let url = components.query?.components(separatedBy: "=").last?.addingPercentEncoding(withAllowedCharacters:NSCharacterSet.urlFragmentAllowed)
originURL = URL(string: url!)
}
loader = VGPlayerResourceLoader(url: originURL!)
Expand Down

0 comments on commit 0f420b4

Please sign in to comment.