Skip to content

Commit

Permalink
Merge pull request #16 from PSPDFKit/matthias/video-bugfixes
Browse files Browse the repository at this point in the history
Disable undo manager while adding annotations.
  • Loading branch information
steipete committed Mar 4, 2014
2 parents 898c7f3 + ce77da0 commit c8e528c
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions Examples/PSPDFCatalog/Multimedia/PSCMultimediaExample.m
Expand Up @@ -56,9 +56,11 @@ - (UIViewController *)invokeWithDelegate:(id<PSCExampleRunnerDelegate>)delegate
document.annotationSaveMode = PSPDFAnnotationSaveModeDisabled;

// dynamically add video box
PSPDFLinkAnnotation *videoLink = [[PSPDFLinkAnnotation alloc] initWithURLString:@"pspdfkit://[autostart:false, cover:true]localhost/Bundle/big_buck_bunny.mp4"];
videoLink.boundingBox = CGRectInset([document pageInfoForPage:0].rotatedPageRect, 100.f, 100.f);
[document addAnnotations:@[videoLink]];
[document.undoController performBlockWithoutUndo:^{
PSPDFLinkAnnotation *videoLink = [[PSPDFLinkAnnotation alloc] initWithURLString:@"pspdfkit://[autostart:false, cover:true]localhost/Bundle/big_buck_bunny.mp4"];
videoLink.boundingBox = CGRectInset([document pageInfoForPage:0].rotatedPageRect, 100.f, 100.f);
[document addAnnotations:@[videoLink]];
}];

return [[PSPDFViewController alloc] initWithDocument:document];
}
Expand Down Expand Up @@ -86,9 +88,11 @@ - (UIViewController *)invokeWithDelegate:(id<PSCExampleRunnerDelegate>)delegate
document.annotationSaveMode = PSPDFAnnotationSaveModeDisabled;

// Dynamically add video box.
PSPDFLinkAnnotation *video = [[PSPDFLinkAnnotation alloc] initWithURLString:@"pspdfkit://youtube.com/embed/8B-y4idg700?VQ=HD720"];
video.boundingBox = CGRectMake(70.f, 150.f, 470.f, 270.f);
[document addAnnotations:@[video]];
[document.undoController performBlockWithoutUndo:^{
PSPDFLinkAnnotation *video = [[PSPDFLinkAnnotation alloc] initWithURLString:@"pspdfkit://youtube.com/embed/8B-y4idg700?VQ=HD720"];
video.boundingBox = CGRectMake(70.f, 150.f, 470.f, 270.f);
[document addAnnotations:@[video]];
}];

return [[PSPDFViewController alloc] initWithDocument:document];
}
Expand Down

0 comments on commit c8e528c

Please sign in to comment.