Woodo 1.4.0

Woodo 1.4.0

TestsTested
LangLanguage Obj-CObjective C
License Apache 2
ReleasedLast Release Dec 2014

Maintained by Unclaimed.



Woodo 1.4.0

  • By
  • Gokhan Baris Aker

Woodo Framework (v1.4.0)

Requirements

  • Minimum deployment target

    • iOS 6.0
  • Auto Reference Counting (ARC)

    • Yes, it requires ARC.
  • Frameworks

    • As of "-ObjC" flag must be defined, no need to link additional binary libraries (frameworks)

Installation

  • Framework installation

    • Drag and drop

      1. Drag "Woodo.framework" into "Frameworks" folder. If folder is not visible at the left side of XCode window, you could reveal navigation bar with (command + shift + j) keyboard shortcut and find it under your project. A dialog for file adding options will appear

        Alt text

        Alt text

        . On dialog;

        • Create groups for any added folders and

          Alt text

        • "YourProjectName" at "Add to targets" section.

          Alt text

        must be selected.

        If cloned Woodo's git repository, it is recommended, but not mandatory, to un-check (de-select) "Copy items into destination group's folder (if needed)", as keeping repository up-to-date would be much more easier.

      2. Now, you have to add 'Other Linker Flags'. Click project navigator icon Alt text at upper-left corner (below run button)

        ! If unable to see project navigator, navigator might be closed. You could reveal navigation bar with (command + shift + j) keyboard shortcut.

      3. Select your project from project navigator

        Alt text

      4. Select project target

        Alt text

      5. Select "Build settings" tab

        Alt text

      6. Search for "Other Linker Flags"

        Alt text

      7. Add "-ObjC" flag

        Alt text

      , and you are done.

      ! To dive in coding, see "How to use" section below. ! Have questions, ask them on StackOverflow: http://stackoverflow.com/questions/tagged/woodo

    • Adding from project settings

      1. Click project navigator icon Alt text at upper-left corner (below run button)

        ! If unable to see project navigator, navigator might be closed. You could reveal navigation bar with (command + shift + j) keyboard shortcut.

      2. Select your project from project navigator

        Alt text

      3. Select project target

        Alt text

      4. Select "Build Phases" tab

        Alt text

      5. Open "Link with binary libraries"

        Alt text

      6. Select "Add items" Alt text. Framework and library chooser dialog will open

        Alt text

      7. Select "Add other..." Alt text

      8. Find Woodo.framework at the opened dialog

        Alt text

      9. Select "Open" Alt text

      10. Now, you have to add 'Other Linker Flags'. Click project navigator icon Alt text at upper-left corner (below run button)

        ! If unable to see project navigator, navigator might be closed. You could reveal navigation bar with (command + shift + j) keyboard shortcut.

      11. Select your project from project navigator

        Alt text

      12. Select project target

        Alt text

      13. Select "Build settings" tab

        Alt text

      14. Search for "Other Linker Flags"

        Alt text

      15. Add "-ObjC" flag

        Alt text

      , and you are done.

      ! To dive in coding, see "How to use" section below. ! Have questions, ask them on StackOverflow: http://stackoverflow.com/questions/tagged/woodo

How to use

  • Setup -

    In order to use Woodo Framework properly "AccessToken", "AppToken" and "ClientSecret" parameters need to be decleared on WPManager class before usage. It is recommended to perform setup on "UIApplicationDelegate" instance's "application:application didFinishLaunchingWithOptions:." selector.

    i.e

      - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
      {
        // Override point for customization after application launch.
    
        // ...
    
        [WPManager setAccessToken:@"<Please contact [email protected] for access token data>"];
        [WPManager setAppToken:@"<Please contact [email protected] for app token data>"];
        [WPManager setClientSecret:@"<Please contact [email protected] for client secret data>"];
        // ...
    
        return YES;
      }
  • iPhone

    • Basic usage

      • Import required headers

          #import <Woodo/WPManager.h>

        Note that: Only presentation is allowed to use at iPhone environment.

        • Call presentation method over WPManager's shared instance with required parameters
        NSURL *url = [NSURL URLWithString:@"<Your video content url>"];
        NSString *token = @"<Please contact [email protected] for player token data>";
        
        [[WPManager sharedManager]
          presentWoodoWithUrl:url
          token:token
          attachmentView:nil
          shareText:nil
          shareTitle:nil
          shareRecipients:nil
          presentationHandler:nil
          startHandler:nil
          progressHandler:nil
          finishHandler:nil
          errorHandler:nil];
      • Add default video controllers

        • Import required assets by simply dragging WoodoImages.xcassets folder inside project

        • Import required headers

          #import <Woodo/WPDefaultVideoControllerView.h>
        • Import required assets

          • Drag and drop

            1. Drag "WoodoImages.xcassets" into "Project" folder. If folder is not visible at the left side of XCode window, you could reveal navigation bar with (command + shift + j) keyboard shortcut and find it under your project. A dialog for file adding options will appear

              Alt text

              Alt text

              . On dialog;

              • Create groups for any added folders and

                Alt text

              • "YourProjectName" at "Add to targets" section.

                Alt text

              must be selected.

              If cloned Woodo's git repository, it is recommended, but not mandatory, to un-check (de-select) "Copy items into destination group's folder (if needed)", as keeping repository up-to-date would be much more easier.

          • Adding from project settings -

            1. Click project navigator icon Alt text at upper-left corner (below run button)

              ! If unable to see project navigator, navigator might be closed. You could reveal navigation bar with (command + shift + j) keyboard shortcut.

            2. Select your project from project navigator

              Alt text

            3. Select project target

              Alt text

            4. Select "Build Phases" tab

              Alt text

            5. Open "Copy bundle resources"

              Alt text

            6. Select "Add items" Alt text. Bundle resource chooser dialog will open

              Alt text

            7. Select "Add other..." Alt text

            8. Find WoodoImages.xcassets at the opened dialog

              Alt text

            9. Select "Open" Alt text

        • Pass new instance of WPDefaultVideoController to "presentWoodoWithUrl:token:attachmentView:shareText:shareTitle:shareRecipients:presentationHandler:startHandler:progressHandler:finishHandler:errorHandler:." selector.

        UIView *attachmentView = [WPDefaultVideoControllerView new];
        
        [[WPManager sharedManager]
          presentWoodoWithUrl:url
          token:token
          attachmentView:attachmentView
          shareText:nil
          shareTitle:nil
          shareRecipients:nil
          presentationHandler:nil
          startHandler:nil
          progressHandler:nil
          finishHandler:nil
          errorHandler:nil];

        If given, attachment view will be added to main content, content you want to play, with same size with video player's boundaries.

      • Add social share data

        // Used for facebook, twitter & mail share options (Required)
        NSString *shareText = @"Mobilike'ın yeni sitesi yayında - http://mobilike.com/";
        // Only used for mail share options (Optional)
        NSString *shareTitle = @"Mobilike";
        // Only used for mail share options
        NSArray *shareRecipients = @[@"[email protected]"];
        
        [[WPManager sharedManager]
          presentWoodoWithUrl:url
          token:token
          attachmentView:nil
          shareText:shareText
          shareTitle:shareTitle
          shareRecipients:shareRecipients
          presentationHandler:nil
          startHandler:nil
          progressHandler:nil
          finishHandler:nil
          errorHandler:nil];
      • Add event handlers

          void(^presentationHandler)() = ^(){
        
            NSLog(@"Presented (Available on UI)");
          };
        
          void(^startHandler)() = ^(){
        
            NSLog(@"Started");
          };
        
          void(^progressHandler)(CGFloat currentTime, CGFloat duration) = ^(CGFloat currentTime, CGFloat duration){
        
            // Video progress updated
            NSLog(@"%f / %f", currentTime, duration);
          };
        
          void(^finishHandler)() = ^(){
        
            // Handle finish here
            NSLog(@"Finished");
          };
        
          void(^errorHandler)() = ^(){
        
            // Handle error here
            NSLog(@"Error");
          };
        
          [[WPManager sharedManager]
            presentWoodoWithUrl:url
            token:token
            attachmentView:nil
            shareText:nil
            shareTitle:nil
            shareRecipients:nil
            presentationHandler:presentationHandler
            startHandler:startHandler
            progressHandler:progressHandler
            finishHandler:finishHandler
            errorHandler:errorHandler];
  • iPad -

    • Basic usage

      • As subview

        • Import required headers

            #import <Woodo/WPManager.h>

          Note that: Only presentation is allowed to use at iPhone environment.

          • Call presentation method over WPManager's shared instance with required parameters
          NSURL *url = [NSURL URLWithString:@"<Your video content url>"];
          NSString *token = @"<Please contact [email protected] for player token data>";
          
          [[WPManager sharedManager]
          addWoodoToView:self.videoThumbnail
          url:url
          token:token
          attachmentView:nil
          shareText:nil
          shareTitle:nil
          shareRecipients:nil
          presentationHandler:nil
          startHandler:nil
          progressHandler:nil
          finishHandler:nil
          errorHandler:nil];
        • Add default video controllers

          • Import required assets by simply dragging WoodoImages.xcassets folder inside project

          • Import required headers

            #import <Woodo/WPDefaultVideoControllerView.h>
          • Import required assets

            • Drag and drop

              1. Drag "WoodoImages.xcassets" into "Project" folder. If folder is not visible at the left side of XCode window, you could reveal navigation bar with (command + shift + j) keyboard shortcut and find it under your project. A dialog for file adding options will appear

                Alt text

                Alt text

                . On dialog;

                • Create groups for any added folders and

                  Alt text

                • "YourProjectName" at "Add to targets" section.

                  Alt text

                must be selected.

                If cloned Woodo's git repository, it is recommended, but not mandatory, to un-check (de-select) "Copy items into destination group's folder (if needed)", as keeping repository up-to-date would be much more easier.

            • Adding from project settings -

              1. Click project navigator icon Alt text at upper-left corner (below run button)

                ! If unable to see project navigator, navigator might be closed. You could reveal navigation bar with (command + shift + j) keyboard shortcut.

              2. Select your project from project navigator

                Alt text

              3. Select project target

                Alt text

              4. Select "Build Phases" tab

                Alt text

              5. Open "Copy bundle resources"

                Alt text

              6. Select "Add items" Alt text. Bundle resource chooser dialog will open

                Alt text

              7. Select "Add other..." Alt text

              8. Find WoodoImages.xcassets at the opened dialog

                Alt text

              9. Select "Open" Alt text

          • Pass new instance of WPDefaultVideoController to "presentWoodoWithUrl:token:attachmentView:shareText:shareTitle:shareRecipients:presentationHandler:startHandler:progressHandler:finishHandler:errorHandler:." selector.

              UIView *attachmentView = [WPDefaultVideoControllerView new];
            
              [[WPManager sharedManager]
               addWoodoToView:self.videoThumbnail
               url:url
               token:token
               attachmentView:attachmentView
               shareText:nil
               shareTitle:nil
               shareRecipients:nil
               presentationHandler:nil
               startHandler:nil
               progressHandler:nil
               finishHandler:nil
               errorHandler:nil];

          If given, attachment view will be added to main content, content you want to play, with same size with video player's boundaries.

        • Add social share data

          // Used for facebook, twitter & mail share options (Required)
          NSString *shareText = @"Mobilike'ın yeni sitesi yayında - http://mobilike.com/";
          // Only used for mail share options (Optional)
          NSString *shareTitle = @"Mobilike";
          // Only used for mail share options
          NSArray *shareRecipients = @[@"[email protected]"];
          
          [[WPManager sharedManager]
          addWoodoToView:self.videoThumbnail
          url:url
          token:token
          attachmentView:nil
          shareText:shareText
          shareTitle:shareTitle
          shareRecipients:shareRecipients
          presentationHandler:nil
          startHandler:nil
          progressHandler:nil
          finishHandler:nil
          errorHandler:nil];
        • Add event handlers

            void(^presentationHandler)() = ^(){
          
              NSLog(@"Presented (Available on UI)");
            };
          
            void(^startHandler)() = ^(){
          
              NSLog(@"Started");
            };
          
            void(^progressHandler)(CGFloat currentTime, CGFloat duration) = ^(CGFloat currentTime, CGFloat duration){
          
              // Video progress updated
              NSLog(@"%f / %f", currentTime, duration);
            };
          
            void(^finishHandler)() = ^(){
          
              // Handle finish here
              NSLog(@"Finished");
            };
          
            void(^errorHandler)() = ^(){
          
              // Handle error here
              NSLog(@"Error");
            };
          
            [[WPManager sharedManager]
             addWoodoToView:self.videoThumbnail
             url:url
             token:token
             attachmentView:nil
             shareText:nil
             shareTitle:nil
             shareRecipients:nil
             presentationHandler:presentationHandler
             startHandler:startHandler
             progressHandler:progressHandler
             finishHandler:finishHandler
             errorHandler:errorHandler];
      • As modal view controller

        • Import required headers

            #import <Woodo/WPManager.h>
        • Call presentation method over WPManager's shared instance with required parameters

          NSURL *url = [NSURL URLWithString:@"<Your video content url>"];
          NSString *token = @"<Please contact [email protected] for player token data>";
          
          [[WPManager sharedManager]
            presentWoodoWithUrl:url
            token:token
            attachmentView:nil
            shareText:nil
            shareTitle:nil
            shareRecipients:nil
            presentationHandler:nil
            startHandler:nil
            progressHandler:nil
            finishHandler:nil
            errorHandler:nil];
        • Add default video controllers

          • Import required assets by simply dragging WoodoImages.xcassets folder inside project

          • Import required headers

              #import <Woodo/WPDefaultVideoControllerView.h>
          • Import required assets

            • Drag and drop

              1. Drag "WoodoImages.xcassets" into "Project" folder. If folder is not visible at the left side of XCode window, you could reveal navigation bar with (command + shift + j) keyboard shortcut and find it under your project. A dialog for file adding options will appear

                Alt text

                Alt text

                . On dialog;

                • Create groups for any added folders and

                  Alt text

                • "YourProjectName" at "Add to targets" section.

                  Alt text

                must be selected.

                If cloned Woodo's git repository, it is recommended, but not mandatory, to un-check (de-select) "Copy items into destination group's folder (if needed)", as keeping repository up-to-date would be much more easier.

            • Adding from project settings -

              1. Click project navigator icon Alt text at upper-left corner (below run button)

                ! If unable to see project navigator, navigator might be closed. You could reveal navigation bar with (command + shift + j) keyboard shortcut.

              2. Select your project from project navigator

                Alt text

              3. Select project target

                Alt text

              4. Select "Build Phases" tab

                Alt text

              5. Open "Copy bundle resources"

                Alt text

              6. Select "Add items" Alt text. Bundle resource chooser dialog will open

                Alt text

              7. Select "Add other..." Alt text

              8. Find WoodoImages.xcassets at the opened dialog

                Alt text

              9. Select "Open" Alt text

          • Pass new instance of WPDefaultVideoController to "presentWoodoWithUrl:token:attachmentView:shareText:shareTitle:shareRecipients:presentationHandler:startHandler:progressHandler:finishHandler:errorHandler:." selector.

            UIView *attachmentView = [WPDefaultVideoControllerView new];
            
            [[WPManager sharedManager]
              presentWoodoWithUrl:url
              token:token
              attachmentView:attachmentView
              shareText:nil
              shareTitle:nil
              shareRecipients:nil
              presentationHandler:nil
              startHandler:nil
              progressHandler:nil
              finishHandler:nil
              errorHandler:nil];

          If given, attachment view will be added to main content, content you want to play, with same size with video player's boundaries.

        • Add social share data

          // Used for facebook, twitter & mail share options (Required)
          NSString *shareText = @"Mobilike'ın yeni sitesi yayında - http://mobilike.com/";
          // Only used for mail share options (Optional)
          NSString *shareTitle = @"Mobilike";
          // Only used for mail share options
          NSArray *shareRecipients = @[@"[email protected]"];
          
          [[WPManager sharedManager]
            presentWoodoWithUrl:url
            token:token
            attachmentView:nil
            shareText:shareText
            shareTitle:shareTitle
            shareRecipients:shareRecipients
            presentationHandler:nil
            startHandler:nil
            progressHandler:nil
            finishHandler:nil
            errorHandler:nil];
        • Add event handlers

            void(^presentationHandler)() = ^(){
          
              NSLog(@"Presented (Available on UI)");
            };
          
            void(^startHandler)() = ^(){
          
              NSLog(@"Started");
            };
          
            void(^progressHandler)(CGFloat currentTime, CGFloat duration) = ^(CGFloat currentTime, CGFloat duration){
          
              // Video progress updated
              NSLog(@"%f / %f", currentTime, duration);
            };
          
            void(^finishHandler)() = ^(){
          
              // Handle finish here
              NSLog(@"Finished");
            };
          
            void(^errorHandler)() = ^(){
          
              // Handle error here
              NSLog(@"Error");
            };
          
            [[WPManager sharedManager]
              presentWoodoWithUrl:url
              token:token
              attachmentView:nil
              shareText:nil
              shareTitle:nil
              shareRecipients:nil
              presentationHandler:presentationHandler
              startHandler:startHandler
              progressHandler:progressHandler
              finishHandler:finishHandler
              errorHandler:errorHandler];
  • WoodoView & WoodoViewController callbacks

    • Start handler

      Called when user content started playing.

    • Progress update handler

      Called when user video content updated progress.

    • Finish handler

      Called when all media playpack finished.

    • Error handler

      Called when any kind of error occured.

  • Custom player controllers -

    // TODO:

  • See sample project for usage

    ! On iPhone environment, it is mandatory to present WPWoodoViewController.