Giter Club home page Giter Club logo

ios's People

Contributors

anubhavpulkit avatar baquer avatar codedentwickler avatar cpg avatar csoni111 avatar iswiftshek avatar jogendra avatar magauran avatar marton-zeisler avatar rudrankriyam avatar sameesunkaria avatar shresthpratapsingh avatar tusharjindal353 avatar vaibhavbisht06 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ios's Issues

screen saver comes on while play is happening

We should not allow the screen saver mechanisms while audio/video play[1] is going on.

I experienced this twice, where the app is playing video (I assume audio as well, but not tried it) and the screen starts dimming, and if the screen is not touched in a bit, eventually the screen turns off and the system locks.

[1] maybe other players, like ebook, pdf, etc.

browsing is caching too hard

I have verified that once a folder is read, it's cached for a long time (forever?) even with a pull-down-to-refresh.

There isn't even an attempt to contact the server with an etag to see if the content changed. The folder appears permanently stuck.

It still happens even if the app is dismissed an started over.

Implement Automatic connection mode

Automatic mode requirements:

  1. The app has to always use the LAN connection if it's available when Automatic is selected in the settings.
  2. The app has to have a Automatic mode in settings. When selected, the app autodetects when LAN mode is possible.
  3. Automatic mode has to be made the default when the app starts for the very first time.
  4. The app must never switch this setting by itself. The user has full control of the Automatic/LAN/Remote switch in the settings area all the time.
  5. A suggested method for reachability detection if LAN mode is available is trying to access the local server IP with a path of /shares with a short timeout (say, 3 seconds). If it returns a valid json response, LAN connection is reachable/available.
  6. The app must not be testing the LAN connection too often. Say at most 4 seconds apart. This can be achieved via a local cached result and a timestamp on the reachability test. If one test of reachability was done less than 4 seconds ago, the result of the test is the same as the one in the last test. This is to prevent potential swamping of tests on the server.
  7. Things can be simplified further by only doing checks of reachability of the LAN server when network conditions change, for example with Reachability or GCNetworkReachabilityStatus
  8. There has to be some visual indication to the user when remote connection is being used

video player: button to select audio track

the player should have a button to select the audio track when the video has multiple audio tracks.

the button should come up visually enabled if there is more than one audio track or visually disabled (or not shown at all) if there is only one audio track.

File names are sometimes long, sometimes shortened with dots

There are some inconsistencies in the way labels are presented. I am not sure what's happening, so these things below are my observations, with my data set.

Definition ellipsized: a word I just made up to mean reducing the length of a label or name and an ellipsis ... placed at the end of the reduced label. (surely there is a name for this already?)

If the rendering is wide first, the longest labels[*] are ellipsized to fit. If the device is rotated to a shorter view, it appears the labels are shortened further dynamically. another rotation to wide works well. * however, some names that are not too long have been ellipsized unnecessarily already in the wide view, for some reason that I can't understand. This also happens in ultra-wide devices like an iPad.

Now, if the rendering is vertical first (I think), it appears that perhaps the length is determined by that. So the labels are ellipsized, but when rotated, but the ellipsized labels are not expanded. Interestingly, doing a pull-down-to-refresh does not help. I am not sure this is a big deal, as probably the user would not want to lose what they are looking at, so re-rendering may lose the focus?

There is a lot of room for intelligent algorithms here.

For example, it's common that there are many files with the same name, e.g. for audio books, or TV show episodes,

The Today Show Starring Some Guy or Gal - 5x11 - Tyler Perry, Lea Michele, Jhene Aiko, Big Sean.mkv

So they show up as The Today Show Starring Some Guy or Gal - ... or something like that.

So, one smart thing to do may be to detect if all files (or virtually all, for brownie points) have the exact same beginning, they could all be removed and displayed without the common string, i.e., 5x11 - Tyler Perry, Lea Michele, Jhene Aiko, Big Sean.mkv. Perhaps the common subexpression could be used as a "group label" and all the rest could be indented below the group label (like a "virtual folder").

App core design, look and feel

We have a great login screen and flow. This issue is for coming up for a design (or at least several sketches) of what the app should look once the user is logged in, the core design.

We need to work on the way the core of the app needs to look and behave. We may need to survey popular apps that do similar things as to what we need (hierarchical navigation, within a main top level) and get some inspiration from them..

We may have to mock up a few designs to get us going an choose something that we feel works well.

At the top level we need:

  1. Relatively easy access to the settings area. This may not be needed in all views, maybe perhaps only at the top level. One possibility is a hamburger menu, or a gear icon.

  2. For servers, we only need something simple, though long-term we may want to have many servers (once we get server-sharing working)

  3. For shares, we need a top level list and recursive navigation capabilities, with opening/handling of many types of files, thumbnail and metadata display. Our Android app does this nicely, so it may be a good reference (not for being copied at the pixel level, but the navigation and look/feel of it).

  4. It's crucial that the app handles many file types well. Specifically audio play, video play, PDFs, other docs, etc., possibly launching existing apps (e.g. a .mobi file should be opened with an ebook reader an let the user choose, maybe). Android does this at the OS level (i think) where the user chooses the app to handle an whether it should be done "always" or "just once". I don't think iOS does this. One example of a top-tier app that does a lot of this is Dropbox.

  5. For apps, we need a list (typically a handful of apps, perhaps a dozen) and the ability to launch an embedded browser into each app, where each browser has to be easy to exit, however, cookies and perhaps even context (what url it was) may need to be remembered.

  6. The app should work well in tablets as well as phones, in both landscape and portrait orientations. It's hard to make it all work in every single case, but we should be at least be making things relatively easy in the small form factor as well as portrait mode.

Use of FaceID and TouchID

use touch id to remember user credentials and login with the fingerprint reader.

i will try and design a proper flow -- maybe the most basic is to add a toggle in settings to use touch id and ask the user to verify at that moment with it, the use it afterwards if enabled, until it's disabled.

the login page may need a little fingerprint "icon" somewhere -- or maybe just try touch id if enabled unless the user cancels.

implement local access mode

since we don't have a settings area yet (!), we need a way to select local access mode.

a simple ad-hock would be a simple switch or comment in the code to enable this, without ui.

an even simpler thing would be to point out where the IP of the file server can be overridden, so local access can be tested.

video player: sample good UI

here are some sample images of a video player (an html5 one in a browser) that is kind of nice looking. I think we should get inspiration from it.

There samples, ipad, iphone vertical, iphone horizontal.

Notice how the grey areas are really just white (or light gray) but translucent.

img_e0041
img_7053
img_7059

video player: gestures strategy

We need some strategy/planning for gestures while the app is in the video player. Ideally, we would have these:

  • swipe up/down anywhere: volume up/down
  • tap or double-tap ... multiple tap in the left of right of the screen moves play head back or forward by an extra 15s
  • in the yet-to-exist scroll bar -- when dragging on the scrollbar position head, the play head is scrolled by that much in the video file. Ideally, if the drag is lowered in the screen, the scrolling speed is slowed down proportionally to the distance from the scrollbar

toggling sorting of the display of folders/files

we will need to add an easy way to toggle sorting alphabetically vs latest. the current production app has a button on the top right (where the signout is now, which should be in the settings area).

the default listing of files/folders should be latest mtime first (including soon, even without the sorting toggle).

login requirements

the login requirements are as follows:

UI:

  • logo, up top, typically
  • "Username or email" field, should show an email keyboard
  • "Password" field, regular keyboard, secure
  • those two fields must not be occluded by the keyboard pulling up
  • "Login" button

Once these fields collected, the app has to use Oauth 2.0 to login.

The details of the url to use have to be loaded from a file in the code e.g. a definition file or something, however, the real credentials must not be committed in the git repo, as they are not public information:

  • amahi login url
  • amahi proxy url
  • client id
  • client secret

once logged in, the user must remain logged in until the user taps on some logout button/link (typically under some settings page that will include among other things this logout).

until it has such a functionality, the logout button/link can be anywhere, e.g. the header.

viewing pictures is often impossibly slow and often does not work

i often see the following behavior:

  • open a folder with a small amount of pictures
  • the first one may or may not load. the AA server does not see the requests (some times)
  • if the first one does not load (spinner on), so do not the other pictures
  • if the first one loads, often, but not always, all others are loaded in the background
  • loading images is really slow -- with a local access, it should be blazing fast. it's not unusual for a file that is < 100K to take > 5 seconds to display.

basically, it's very very flaky, it seems to fail internally and some of the algorithms for filtering may not be working well?

credentials must be kept in between invokations of the app

If the app is closed or reclaimed by iOS, it appears that the user is asked to re-login. This is not acceptable for day to day use.

The session credentials (not the user/password) have to be kept across invocations, long term. There may be OS facilities to keep them safely.

video player: fading of UI elements should start after play starts

currently, fading of UI elements starts shortly after the player takes the screen. often, play takes a few seconds to start (possibly buffering?), but the UI has faded, so it can be a little worrying to see a black screen.

the fading should start after play starts, ideally one second in or so after play actually starts.

Adding Network Singleton class for all the API calling

Since we are using alamofire for API calling and other network stuff, I created a Network.swift file where I implemented all the methods like post, get, postWithFormData, put, patch, delete, uploadFiles, downloadImage etc with alamofire. All the methods have completion handlers that return parsed JSON, status code, error etc. I created a singleton of this class. We just have to call Network.shared.post(..) (whatever we require). Everything else is handled by Network class.
Benefits:

  • Well written methods for all HTTP requests.
  • Easy response code and error handling.
  • Do not need to import Alamofire in ViewControllers and other places. We just have to call singleton method.
    Should I add network file to project? We can discuss and give try to this!

handling PDF/MOBI/EPUB files

files that require opening the file with some other external app, for example, PDF/MOBI/EPUB for digital documents/presentations/books.

i assume some of these mime types could be opened within the app (e.g. PDF with a webview perhaps), but generally, we need to get external apps to get a file that this app (probably) has downloaded and the external app is called.

Chromecast Support

Chromecast Support

Chromecast support lets you stream videos and audio from your Amahi app to your TV or speakers.

Setup

Using Cocoapods

pod ‘google-cast-sdk’
pod ‘google-cast-remote-display-sdk’

Steps To Be Perform

-> Install Cocoapods
-> Add cast Button
-> Devices Scanning
-> Select device after Scanning
-> work with media channel i.e. Media control Channel
-> load the media
-> Define Media Information.
-> Cast the media
-> Add mini controller
-> Add Expanded controller
-> Before publishing we need to run shell script strip_unused_archs.sh to strip unused
architectures from the app bundle

video player: pause when the currently used audio device is disconnected

this also applies to the audio player when we have one.

in iOS all audio/video playing apps that i know of will pause automatically when the currently used audio device is disconnected.

for example, when the headphones are unplugged, or the bluetooth device runs out of battery or powered off.

our players should do the same.

video player: play should handle audio device events sensibly

when connecting and disconnecting an audio output device, the player should handle it properly, like other top video players in iOS.

i don't quite know the exact rules other players use, but the built in player does things "naturally" gently as follows:

If audio is playing:

  • if headphones are disconnected, play should pause
  • if bluetooth headphones/speakers are connected, play should continue
  • if headphones are connected, play should continue
  • there may be others, but i am not sure ...

if play is paused, under no circumstances play should resume on audio device events. the user must enable the play by manual interaction with the play head (scrobbling) or the play button.

Servers browser, shares browser and apps browser

The app, at the highest level (once the user is logged in), consists a Server browser, and with a server selected, then a Share browser and and App browser.

Servers

A user may have one or more servers. If a user has three servers called "joe" "joe-2" "Welcome to Amahi", the user should be able to see them up top in the app.

The user must be able to get back "up" to this level to select any other browser.

Browsers may be active or inactive as given by the API, It should be clear to the user which one(s) are active and which ones are inactive. The user must be able to select an active server at any time.

If there is only ONE and exactly ONE server that is active at the moment, it should be automatically selected.

When a server is selected, the user should have the ability to select Shares or Apps.

Careful attention should be placed in proper error display so that the user sees graceful errors in case a server goes inactive (e.g. if the user loses WiFi -- simplest way to test this error).

Shares

When browsing shares, the user should see the shares of the selected server. Once selected, the user should then be able to browse all files and folders in the share and recursively navigate them. We will talk about opening them, thumbnails, handling internally or sending to other apps, sharing, etc., in a separate specification.

Apps

Separated to #45.

Misc Requirements

The app has to work on phones as well as larger tablets, both in portrait and landscape modes.

Built in video player (VLCKit integration)

We will sooner or later need to integrate with VLCKit which I believe is available as a Pod these days (according to what the lead of VLC told us in the last GSoC mentors meeting).

There are some assets (icons for play button, subs, audio track, aspect ratio) etc.). We can provide them when needed (we have to extract them first, though the format may have changed). We also will want some icon for a "forward 15 seconds" button and a "back 15 seconds" button.

There are ways to test this (we can provide URLs for testing) without having to develop a the browser aspects of the app. e.g. a simple menu of links to play. This is so that it can be integrated in parallel.

Browsing Apps

The app, at the highest level (once the user is logged in), consists a Server browser, and with a server selected, then a Share browser and and App browser. The first two were addressed in #8. This issue is for App browsing.

Apps

When browsing Apps, the user should see the currently available apps installed in the selected server. Selecting an app launches a built-in browser, full screen (except some way to get back to the app, e.g. a Done button), running the app. This browser has to be able to hold cookies about invocations and other things we will specify separately.

video player: 15s forward or back

one very useful feature in video players is a quick button to go forward 15 seconds or back 15 seconds.

ideally, this could be done with some gestures and no icons. for example, if one imagines the screen divided in two parts down the middle, if the user double-taps on the left side of the screen, the video could go back 15 seconds. if the user double-taps on the right side of the screen, the video should go forward 15 seconds.

visual feedback: ideally the user should see some feedback visually with some small indication somewhere that 15s >> of << 15s happened.

the app should definitely not be blocking all or even a substantial part of the screen for this -- the user is watching something after all!

bonus points: if the user triple-taps the video should go back or forward by 30 seconds instead.

double bonus points: if the user taps four times in a for, the video should go back or forward by 45 seconds instead.

Landscape orientation

The app is working fine with iPads, but need to be made compatible with iPhones, with a split screen view.

files are not aligned with folders

Files and folders are not aligned at the left. files are slightly indented. It's very unsettling 😱

The disclosure indicator > at the end of a folder is enough to tell.

Reusable components, style guideline and suggestions

Development of this project is started just few days ago so I want to create some Reusable components that can be applied to iOS applications developed throughout the organization. Also, I want to propose swift style guide and best ios development practices.

Reusable Components
Rather than calling functions and methods again and again, we can create reusable components. This will help us writing clean code and save our time.

  • Extension file - add a new file name Extension which will contain Extension of some useful UIKit and some other classes. I added to Dictionary extension unionInPlace in Network.swift file, this should be in Extension file. As the development get process, we will need a lot of Extensions.
  • Views file - here we will create views that we will need at many places in the app. Like alertView, noInternetConnectionView, common error view, networkActivityIndicatorView etc according to our requirements.
  • AppConstants - we can define all the constants like asset images names, userDefaultsKey etc type of constants which is common for the application.
  • How about define Endpoints and Network call all in the same file. Currently, Endpoints are not defined in a good way. can I make a PR Regarding this?

Some other thing I will add in the list.

Style Guidelines
To make the code more cleaner and understandable we should follow Swift Style Guide and some best practices for iOS Development. This will help new contributors a lot. I always try to follow this Swift Style Guide. For best iOS practices I want to suggest this good practices.

Suggestion
I learn some good things about ios development during last internship and Swift meetups. Some of them I share above and some I want to add here -

  • for small purpose rather than adding pods to our project, we can directly drag the file to our project so that we can modify according to our need. Also, many pods contain functionality that is all not useful for us. Please be clear that I am talking just about small pods that can be draggable. Like for parsing JSON I added a SwiftyJSON file to project rather than adding a pod. Rather than using SkyFloatingLabelTextField as a pod, we can drag this file to our project.
  • rather than using string, int or other file constants directly we can create a private struct on the top of the ViewController file. This will make ViewController code a lot cleaner and easy to change the value of constants.
    Ex.
fileprivate struct DefaultConstants {
         static let buttonCornerRadius: CGFloat = 8.0
         static let buttonTitleText: String = "Button"
         static let imageURLString: String = "https//.."
}
  • Put all view controllers in one group, all views in same group etc.
  • Use PDF file at the place of PNG files. PDFs are vectors so we only need to add 1x file and it will look good for all the resolutions. This is recommended by Apple. Also, we do not require 1x, 2x and 3x file for all icons and images.
  • We can use some marketplace tools like Travis CI etc that will make sure everything in PR is perfect before merging it.
    I will add some more points to the list. Everyone suggestions are welcomed so that we can build a great app. @codedentwickler @cpg

video player: scrobbling

the user should be able to "scrobble" on the video. this is basically browsing ("scrolling") through the video duration while the video is playing.

this has traditionally been done through a "scroll bar" at the top of the screen, with a cursor that is always indicating the current position of the "play head" of the video (where the video is playing currently).

there are various things that can be done to make this a smooth experience.

  • tapping in any position of the scrollbar takes the video head to that position
  • if play was paused, play continues after tapping, but the position is new
  • if video was playing, video continues playing from that position
  • tapping and holding on the cursor allows the user to move the cursor to the desired position
  • if play was stopped, play is started from the new position. if video was playing, video continues playing from the new position

Not done yet:

  • bonus point: the speed of the scrolling when the user is dragging the play head is reduced proportionally to the distance away of the drag, from the scrollbar

UI tweaks for login page (and rest of the app)

We may need some UI guidelines going forward, but for now, please take note of the following:

  • The logo as it is now is not official. No shadow on the dice, excessive separation with the letters and incorrect font. Please use our official logo
  • The background should be either black or very dark for the whole of the app, not just the login page. The Android app did it well and it's comfortable to use in low-light situations, which are common usage.

settings area requirements

We will need a settings area for the app.

At the moment we have the following settings:

  • "Connection" switch: a 3-position chooser/switch, Autodetect (default), LAN and Remote
  • A way to "Sign out" of the app back to the login screen
  • An "About" area with the version of the app. We need to identify where this version is picked up from. Maybe a constant in the code for now.
  • A "Feedback" button/link to kick off an email with an email client to support at amahi dot org with Subject "iOS Amahi Anywhere"
  • A "Rate" button/link to let the user rate the app. Please be aware that there may be specific for doing this in iOS for compliance with app store

W may add more settings as we go along.

It has to look clean, needless to say.

viewing image files

we can also start with a basic image viewer.

we can either start one-by-one without interaction, or we can work on some smarts.

smarts can include swipes to see the next one or previous one, preloading next, caching, etc.

controls are all to the left on the ipad

for some reason, even though the rew/play/fwd group of controls are centered and things look great in landscape in iphone, they are nearly all the way to the left on ipad in landscape mode.

photo browser improvements

The Close button is white and to the top-right. this is often hard to see in bright images. the other controls are at the top left, and in electric blue color.

I think the photo browser Close should, for consistency, be also on the top left and in the same color (make it a constant somewhere if possible, so that later we can change them consistently when we tweak the UI).

The controls and the image name as well as the line and counter may be ok as white for now, however, I think they should fade in a few seconds.

my pictures folder chokes the app with a networking error

there appears to be no such error on the call over the network, just the app displays a (rather amateurish-looking "Oops!" error), network error alert. Pulling down does not seem to help.

i can provide the output of my pictures folder (about 578 entries) in private.

missing home icon

the home icon is missing. i thought i originally added the one original from the app when i first created the first commit for the app. in any case it's missing now.

we could go with the older one or go to all black background.

new app logo

I think we should change our app logo.

I think it may be a good idea to make it like the previous one, but with pure black background. The current app logo has an amahi dice that is too large. It you compare to the current app in the app store, you can see how large it is.

The original of the Amahi dice is in the press kit page.

The main picky thing with a black background is the shadow of the dice. It can look bad. Maybe we can try it with and without shadow.

basic play of videos with the built-in player

for now, this is a basic issue to handle a video file.

a file listed in the app should respond to tapping by opening a player full screen and starting play.

once the user taps on "Done" in the player or the file completes playing, the app should return to normal browsing.

the screensaver/lock should not come in during the duration of the play.

we will have more sophisticated player over time, however, this is our most basic interaction requirement: the player controls should fade away after 3 seconds and let the video play unobstructed. if the user taps on the screen, the controls should fade in/appear. tapping again should make them fade out.

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.