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 nil and perform some other operations like presenting a modal view on the

Other Methods

  • + acceptedPrefixes
         As 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

  • – rect

    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.

Other Methods

Class Methods

acceptedPrefixes

     As we are an FPKWebView we can remove the background, otherwise a grayish borded will appear sometimes
+ (NSArray *)acceptedPrefixes

Discussion

     As we are an FPKWebView we can remove the background, otherwise a grayish borded will appear sometimes

Declared In

FPKYouTube.m

respondsToPrefix:

You should implement this method to return a BOOL value only on supported prefixes.

+ (BOOL)respondsToPrefix:(NSString *)prefix

Parameters

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.h

Instance 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 *)manager

Parameters

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 &
  • 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
frame

The annotation frame in pdf page coordinates. If the padding parameter 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=2 and 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.h

rect

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)rect

Return 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

setRect:

Set the original frame. More info on rect.

- (void)setRect:(CGRect)aRect

Parameters

rect

The original frame.

Discussion

Set the original frame. More info on rect.

Declared In

FPKView.h