denivip / ios-vast-player

IAB VAST ads playback in iOS AVPlayer
http://blog.denivip.ru/index.php/2012/08/ios-player-with-vast-video-ad-support/?lang=en
MIT License
82 stars 34 forks source link

(AVPlayerLayer *)self.playerView.layer — casting unsuccessful #2

Closed stuffmc closed 11 years ago

stuffmc commented 11 years ago

This code in the demo app's DVViewController's viewDidLoad:

(AVPlayerLayer *)self.playerView.layer;

actually casts the playerView's layer to an instance of AVPlayerLayer.

When I apply this code in my own app, however, it doesn't casts, but stays an instance of CALayer. My outlet to playeView is strong, nonatomic and the actual UIView object in the .storyboard is an instance of DVPlayerView.

I'm pretty sure this isn't an issue/bug per se but might be something wrong with my code. This might as well be something different with the configuration of my .xcodeproj. Unsure. Any tip/direction?

stuffmc commented 11 years ago

Ob boy. Sometimes RTFM helps — I wasn't paying attention to this in the console

Unknown class DVPlayerView in Interface Builder file. — Reading this helped: http://stackoverflow.com/questions/1725881/unknown-class-myclass-in-interface-builder-file-error-at-runtime

I also wasn't paying that DVPlayerView isn't part of the Classes directory but rather part of the sample.

I'll close the issue, but the README file should really be updated with a few steps to follow to be able to use it. I consider creating a "Wrapper" class with some of the code being in the Demo app.