Giter Site home page Giter Site logo

testing's People

Contributors

zanjereb avatar

Watchers

 avatar  avatar

testing's Issues

Include images where possible

  • Get the image URLs from the server for user and for the casts
  • Create a system to download an image from the URL (create a new file/class)
    • To get the data from the url you may use NSData which have a static method called dataWithURL
    • To get the image from data you can call the initializer for UIImage called initWithData
  • Assign the images to cells and to the profile image view

Also look at #17

Modify first screen

  • Remove the button to navigate to my casts
  • Add the same background images as on the my cast screen (the full screen image and the black overlay)

Upload a new created video

To upload the video to the backend there are quite a few things to do. First the recorded video you create is .mov and we need the .mp4. There is a converter you may use that will convert the video for you. After the video is converted you will need to send it to Amazon server (AWS) under specific parameters. After the video is uploaded you need to send a new cast to our server with all the data including the video path on the AWS server. We will hardcode most of the data for now.

Resample the video:

  • Use DLBSegmentedVideoConverter class to convert the video
    • Once the video is done recording you need to create a new instance of converter and assign it as a property so it is not released to soon
    • Set inputURLs on converter which is an array of videos you want to convert. You will need to construct an array with a single object which is the URL you get from the image picker controller
    • Set the output URL of the converted video. Find how to get the temporary directory on iOS and append path like "video.mp4" to it so it will be saved to that location.
    • Set the delegate to get the notification when the converting is done
    • convert the video by calling resampleVideo

Upload the video to AWS:

  • Use OUTAWSHandler shared instance to upload the video (look at its methods) once it is converted
    • Use the output path you receive from the converter. You need to use the url and call .path to get the string path
    • You must generate a unique UUID for every video. I suggest you generate it before the AWS upload and save it as property. Search for NSUUID on how to get a string.
    • The name must be "video.mp4". MUST!
    • on callback check if it is finished to continue the procedure (the block will be called a lot of times but only the last call will be the one with the finished set to YES)
      Send data to our server:
  • Create an instance of OUTAPIRequest for endpoint my casts and type of POST
  • set the parameters which are used as a dictionary but you need DLBDictionary instance
    • parameters[@"title"] = @"Enter some nice name here"
    • parameters[@"country"] = @"Slovenija"
    • parameters[@"city"] = @"Ljubljana"
    • parameters[@"media_id"] = the UUID you used for AWS
    •  parameters[@"channels"] = an array of all the channels you have *see below

To get all the channel IDs you best just get them once the user is downloaded and add the channels to it. You will need to cal the endpoint with my channels (same as other calls) and extract all channel ids into a single array and assign it to the user.

Basic project setup

Rearrange the folder structure by having system such as sources/entryPoint, sources/userInterface

  • Move ViewController and ApplicaitonDelegate files to sources/entryPoint
  • Remove those files form xcode (select them and press backspace)
  • Add folders to xcode by dragging them into project navigator

Integrate the new screen

You will need to assign the new view controller class and bind everything together.

  • In my casts folder create a new class using Cocoa touch class. Use an UIViewController as subclass, name it such as MyCastsViewController
  • In my casts storyboard select the view controller and find where to assign a new class as to MyCastsViewController. You may check how the ViewController is added to Main storyboard
  • Add exit button action to the MyCastsViewController which will exit by calling [self dismissViewController..]
  • Add my casts button action to main view controller to present the new view controller. You need to instanciate the My casts view controller by calling [[UIStoryboard storyboardWithName:@"theName" whatever:nil] isntanciateViewControllerWithWhatever:@"theIdentifierSetInStoryboard"] and then call [self presentViewController:controller ...]

Integrate designs for my cast screen - User data

Create the top view displaying user data. This should be one large view containing other subviews.

  • Create the view beneath the header with a constant height
  • Add a gray-white view with the user data
  • Add the image view showing the user profile
    • For now just set some background color on the image view
    • Enable "clip subviews" for the image view
    • In the code of view controller override - (void)viewWillLayoutSubviews and on the profile image view set the corner radius so it is round as .layer.cornerRadius = .frame.size.width*.5f
  • Add the name label
  •  Add the location label and icon
  •  Add the rest of the labels

Record a new cast

On add cast view controller add a functionality to record a video. Research what is needed to record a video (you will need a real device for this to work). Add some button "New video" to initializing the recording. The video will probably be recorded to some local file whose path you will receive when the video is done recording. When the video is recorded add another button "Preview" which will open a video player controller with the video you just recorded. To get the URL from the file path you need to use [NSURL urlWithFilePath... or something similar.

Add age of the cast to the cell in my casts

Show the text such as "5days 3h 4min"

The days should not be shown for 0 days, same for hours and minutes.

Hint: An NSDate has a method timeIntervalSince which returns a duration in seconds.

Create a new storyboard for MyCasts screen

Under UserInterface folder create another folder for MyCasts. Inside create a new file in Xcode by using storyboard. In the storyboard create a new UIViewController. On the controller create a cancel button which will navigate back to main screen.

  • Create new storyboard by right clicking on the target folder in Xcode and selecting new file. Under user interface find Storyboard and select it then enter some nice name indicating it is about "my casts".
  • Add a view controller to the storyboard by finding it in bottom right of the screen and dragging it to the main window.
  • check where to set a storyboard identifier for the view controller and enter some name for it such as "myCasts".
  • Add a button to the view controller view which will exit this screen

Design main screen to have a button which will navigate to the MyCastsScreen

On main storyboard on main controller add a button. Place it on center or whatever as long as some constraints are added. Drag the button action to view controller source code.

  • Modify the storyboard to include the button. Set a nice name for the user that you will display user casts.
  • From the storyboard ctrl+drag from the button to the source file. Both screens must be open to do so.
  • Drag from button to under @implementation code to generate the method, then set a name for the method.

Make image downloading asynchronous

The NSData procedure will block the thread until the download is complete.
Move this to a new thread and use blocks.

You may use dispatch_async. Should look something like this:

NSURL *imageUrl = [NSURL URLWithString:myURL];

dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{

    thumbnailData = [NSData dataWithContentsOfURL:imageUrl];

    dispatch_async(dispatch_get_main_queue(), ^{
        thumbnail = [UIImage imageWithData:thumbnailData];
        callback(thumbnail)
    });
});

Start building my cast screen

  • create a header with exit button
  • create a table view beneath the header
  • Assign data source and delegate to the table view
  • Add a system to present some testing data in the table view

Add navigation controller to casts screen

  • In storyboard add a navigation controller. This will create 2 controllers but delete the one that is not a navigation controller
  • Connect the casts view controller as a root view controller. Ctrl+drag from navigation controller to casts controller and select root controller
  • Set the identifier to the navigation controller so you may call it from code
  • On main controller call to present the navigation controller (change the identifier to the one you set in storyboard)
  • Remove the navigation bar on the casts view controller (search for "hide navigationbar")

Integrate designs for my cast screen - background

Add a background to the screen by adding 2 views. An image view and an overlay.

  • Export the background image you see in photoshop
  • Add a fullscreen image view to the view controller (make sure it is on the top so it is in background)
  • Add another view over the image view with a black, semitransparent background color as is by designs

Integrate designs for my cast screen - header

There should be a transparent head on the top showing a title and 2 button icons.

  • Export the 2 icons from photoshop
    •  Find the layer on the left on which the icon is drawn by trying to hid it (the eye icon on the left of the list)
    •  Right click the eye icon and select show/hide all layers so only this layer is visible
    • Use the select tool in photoshop (top-left the icon with a square) and select the icon on the canvas by dragging
    • Press cmd+shift+c to copy, press cmd+n to create a new canvas, press ok, press cmd+p to paste it
    •  Hide background layer so you get the transparent background
  • Save the new images as 1x, 2x, 3x
    •  Select file -> save for web
    •  Select the folder path to where the export will be
    •  Use name something like [email protected]
    •  Repeat the procedure for 1x which has the dimensions of 1/3 of the original, the name has no suffix (there is no @1x); and 2x which has a dimensions of 2/3 of original and has a suffix of @2x
  •  Add the new images to asset file in Xcode and add them to the 2 buttons
  • Use label for title

Play the video that is bound to cast

Also get the mp4 link on the cast from the server. When the cell is pressed you should get the link and use MPMoviePlayerViewController to play the video. The controller must be presented.

  • Find the mp4 link and add it to cast object
  • Find a way to be notified when the cell is pressed (should be in a table view delegate)
  • Find a way to present the movie player controller and to make it play the video

Add the create cast view controller

  • In casts storyboard add a new view controller which will be "Add cast".
  • Set some identifier
  • On cast controller header change the right button to show "Add" instead of the icon currently showing
  • On Add button push the new "add cast" view controller by calling [self.navigationController push...] method.
  • Ensure the new controller has a navigation bar with a back button

New navigation

We want to add a bit more screen navigation to the application. You will keep the main screen for loading and then present the current my cast screen non animated. The button from the first screen will be removed and only the background will be used the same as from my cast screen. The second screen will be a navigation controller with the ability to add a new cast.

  • Modify the main screen to show background #10
  • Modify the casts screen to have navigation controller #11
  • Create navigation to the Add cast controller #12

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.