amahi / ios Goto Github PK
View Code? Open in Web Editor NEWAmahi iOS App
Home Page: https://www.amahi.org/ios
License: GNU General Public License v3.0
Amahi iOS App
Home Page: https://www.amahi.org/ios
License: GNU General Public License v3.0
Currently, integer constants are used to represent different mime types. Swift Enumerations is a more suitable way of handling this.
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.
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.
This will ensure compatibility remains with the iPhone 5, 5C, and 5S.
Reason
The Server Address has not been set because the server route wasn't loaded. Hence serveAddress is null/nil, any attempt is made to load shares when the address has not been set will crash the app.
Automatic mode requirements:
Automatic
is selected in the settings./shares
with a short timeout (say, 3 seconds). If it returns a valid json
response, LAN connection is reachable/available.Reachability
or GCNetworkReachabilityStatus
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.
WARNING: Unable to resolve the color named "textMutedColor" from any of the following bundles: com.amahi.AmahiAnywhere-dev, com.amahi.AmahiAnywhere-dev
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").
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:
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.
For servers, we only need something simple, though long-term we may want to have many servers (once we get server-sharing working)
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).
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.
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.
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 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.
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.
We need some strategy/planning for gestures while the app is in the video player. Ideally, we would have these:
implement a ui for selecting subtitles
the ui should present options or each subtitle found in the media (if any).
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).
directions: https://fabric.io/kits/ios/crashlytics/install
i don't know how to add the api key in a sensible way for an open source project.
i'd think we need to keep the api key in our ApiConfig swift file.
the login requirements are as follows:
UI:
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:
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.
i often see the following behavior:
basically, it's very very flaky, it seems to fail internally and some of the algorithms for filtering may not be working well?
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.
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.
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:
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.
A small button in the login view which comes after the login fails once, which leads to this link.
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
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.
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 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.
when search is cleared, the sorting becomes alphabetical.
it should be 1) what the user has selected, if anything was selected, else 2) the default (time, latest first)
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.
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).
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.
Separated to #45.
The app has to work on phones as well as larger tablets, both in portrait and landscape modes.
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.
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.
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.
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.
The app is working fine with iPads, but need to be made compatible with iPhones, with a split screen view.
the Done
button up to should fade away with the other controls also and reappear when the user touches the screen.
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.
the title should change an probably be the name of the folder. ellipsized probably, since the folder name may be too long often.
details of the crash: https://paste.fedoraproject.org/paste/zoYyynX5H23OV7uMhrnk0g/raw
to reproduce: play an mp3 audio file and let it play until the end (or fast forward to near the end and let it finish playing)
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.
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.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 -
SkyFloatingLabelTextField
as a pod, we can drag this file to our project.ViewController
code a lot cleaner and easy to change the value of constants.fileprivate struct DefaultConstants {
static let buttonCornerRadius: CGFloat = 8.0
static let buttonTitleText: String = "Button"
static let imageURLString: String = "https//.."
}
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.
Not done yet:
We may need some UI guidelines going forward, but for now, please take note of the following:
We will need a settings area for the app.
At the moment we have the following settings:
W may add more settings as we go along.
It has to look clean, needless to say.
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.
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.
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.
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.
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.
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.
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.
Run-time warning:
WARNING: The class 'ServerRoute' is not key value coding-compliant for the key 'arch'
There is no support for optional type, array of optionals or enum properties.
As a workaround you can implement the function 'setValue forUndefinedKey' for this. See the unit tests for more information
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.