Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpectedly found nil while unwrapping an optional value if using cocoa pods #24

Closed
AlexChesters opened this issue Jul 2, 2015 · 12 comments

Comments

@AlexChesters
Copy link

In this function

private func playerHTMLPath() -> String {
        return NSBundle(forClass: self.classForCoder).pathForResource("YTPlayer", ofType: "html")!
}
@memetcircus
Copy link

I have ran into the same error. Also Pods_YouTubeVideoPlayer.framework and YouTubePlayer.framework is all red in the navigator.

@AlexChesters
Copy link
Author

Ditto @memetcircus, do you know of any solution/workaround?

@memetcircus
Copy link

Couldn't find any but it seems that it happens if I use cocoa pods

@AlexChesters AlexChesters changed the title Unexpectedly found nil while unwrapping an optional value Unexpectedly found nil while unwrapping an optional value if using cocoa pods Jul 2, 2015
@AlexChesters
Copy link
Author

Same, it looks like the YTPlayer.html is missing

@memetcircus
Copy link

@AlexChesters checkout my fork at my page. I fixed the bug.

@memetcircus
Copy link

Did you install cocoa pods on your machine ?

Mehmet Akif
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)

On Wednesday 15 July 2015 at 17:59, Dante Puglisi wrote:

I'm having the same issue but when using videoPlayer.loadVideoURL(url) (also tried with your fork @memetcircus (https://github.com/memetcircus) with no luck)


Reply to this email directly or view it on GitHub (#24 (comment)).

@Jalsemgeest
Copy link

I'm having this same issue. Any word on a fix? I tried manually changing the file that @memetcircus had changed, however it didn't seem to fix the issue.

@AlexChesters
Copy link
Author

@Jalsemgeest it works perfectly if you don't use cocoapods, only workaround I've found

@DantePuglisi
Copy link

Add YTPlayer.html manually to your project's resources, then change the line I wrote above or fork my version of the project in cocoapods.

On Jul 17, 2015, at 3:15 AM, Jake Alsemgeest notifications@github.com wrote:

I'm having this same issue. Any word on a fix? I tried manually changing the file that @memetcircus had changed, however it didn't seem to fix the issue.


Reply to this email directly or view it on GitHub.

@gilesvangruisen
Copy link
Owner

Hey @memetcircus. Do you think you could open a pull request between your fork and the master branch? Thanks!

@mohanmoorthy
Copy link

If your'e using cocoa pods you will definitely get this error. To resolve this issue I copied the "YTPlayer.html" file into MY PROJECT (not YouTubePlayer) supporting files folder and change the below code in Pods/YouTubePlayer/YouTubePlayer.swift

private func playerHTMLPath() -> String {
// return NSBundle(forClass: self.classForCoder).pathForResource("YTPlayer", ofType: "html")!
return NSBundle.mainBundle().pathForResource("YTPlayer", ofType: "html")!
}

@barthdamon
Copy link

@mohanmoorthy thanks man!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants