FPKYouTube Class Reference
| Inherits from | FPKWebView : UIWebView |
| Conforms to | FPKView |
| Declared in | FPKYouTube.h FPKYouTube.m |
Overview
This Extension is useful to place a YouTube video over the page
Usage
- Prefix: utube://
- Import: #import <FPKYouTube/FPKYouTube.h>
- String: @“FPKYouTube”
Prefixes
utube://xtmmuGIh0F4://
Resources and Parameters
- VIDEO_KEY STRING
With VIDEO_KEY that represents the unique identifier assigned by YouTube to the video itself. To obtain it open the video in a browser and look at the address bar.
http://www.youtube.com/watch?v=xtmmuGIh0F4
the VIDEO_KEY is xtmmuGIh0F4
Sample url
utube://xtmmuGIh0F4
Tasks
Other Methods
-
– initWithParams:andFrame:from:This method is called by the FPKOverlayManager if the Extension supports the requested prefix. You should return the UIView to be placed over the page. You can also return
niland perform some other operations like presenting a modal view on the
Other Methods
-
+ acceptedPrefixesAs we are an FPKWebView we can remove the background, otherwise a grayish borded will appear sometimes
Other Methods
-
+ respondsToPrefix:You should implement this method to return a BOOL value only on supported prefixes.
Other Methods
-
– rectThe frame of the view can change when the pdf mode change and the device is rotated. The original frame is stored to perform the conversion on the fly when needed.
Other Methods
-
– setRect:Set the original frame. More info on rect.
Class Methods
acceptedPrefixes
As we are an FPKWebView we can remove the background, otherwise a grayish borded will appear sometimes
+ (NSArray *)acceptedPrefixesDiscussion
As we are an FPKWebView we can remove the background, otherwise a grayish borded will appear sometimes
Declared In
FPKYouTube.mrespondsToPrefix:
You should implement this method to return a BOOL value only on supported prefixes.
+ (BOOL)respondsToPrefix:(NSString *)prefixParameters
- prefix
The prefix in the form
@"map".
Return Value
YES or NO if the prefix is support by the Extension.
Discussion
You should implement this method to return a BOOL value only on supported prefixes.
Declared In
FPKView.hInstance Methods
initWithParams:andFrame:from:
This method is called by the FPKOverlayManager if the Extension supports the requested prefix.
You should return the UIView to be placed over the page. You can also return nil and perform some other operations like presenting a modal view on the
- (UIView *)initWithParams:(NSDictionary *)params andFrame:(CGRect)frame from:(FPKOverlayManager *)managerParameters
- params
This dictionary contains all the parameters extracted from the url
- prefix the part in the url before
:// - path the part in the url after
:// - params another NSDictionary that contains the parsed parameters after the
://- resource the part before
? - … custom parameters included in the annotation separated by
&
- resource the part before
- load YES if the call for the view is made when the pdf page is going to be loaded, NO if the call is made when the user taps on the annotation area
- prefix the part in the url before
- frame
The annotation frame in pdf page coordinates. If the
paddingparameter is specified in the url, the frame is a CGRectInset of the real annotation frame. This feature is useful if the pdf has been created with Adobe InDesign that creates the annotation 2 pixel wider than the original object. Just specify in the url a param?padding=2and the frame will be set accordingly.
- manager
The FPKOverlayManager that can be used to perform many operations like accessing the MFDocumentViewController or the MFDocumentManager.
Return Value
UIView that will be placed over the pdf page by the FPKOverlayManager.
Discussion
This method is called by the FPKOverlayManager if the Extension supports the requested prefix.
You should return the UIView to be placed over the page. You can also return nil and perform some other operations like presenting a modal view on the
Declared In
FPKView.hrect
The frame of the view can change when the pdf mode change and the device is rotated. The original frame is stored to perform the conversion on the fly when needed.
- (CGRect)rectReturn Value
rect The original frame of the UIView.
Discussion
The frame of the view can change when the pdf mode change and the device is rotated. The original frame is stored to perform the conversion on the fly when needed.
Declared In
FPKView.h