Giter VIP home page Giter VIP logo

khan-academy-fxos's Introduction

Build Status

Khan Academy Firefox OS app

Khan Academy's Firefox OS app source is Mozilla Public License Version 2.0 licensed.

You can download the Khan Academy Firefox OS app on your device at the Firefox Marketplace.

The Khan Academy app also functions as a:

  • Firefox web app for Desktop on OSX, Windows, and Linux are also available at the same link. (No downloads support because Desktop has no Storage API yet)
  • Firefox web app for Android.

About the source

Everything is built using JavaScript. Omniscient which wraps React is used for views and ImmutableJS is used for data. The video player is using VideoJS. The exercises are using Perseus.

Getting setup

git clone --recursive https://github.com/bbondy/khan-academy-fxos

Copy ./secrets.json.sample to ./secrets.json, fill in the info with your API key.
Note that reporting user points will not work unless you have an annointed key.

See here for information on how to apply for a Khan Academy API key:
https://github.com/Khan/khan-api/wiki/Khan-Academy-API-Authentication

Building the source

You need Nodejs installed to run the following commands (please run them in the order given).

npm install
bower install
cd bower_components/katex
make
cd ../../
gulp browser-dev-server&

Navigate to http://localhost:8008. As you make changes webpack will rebundle the sources.

Alternate route of getting setup (not recommended)

To run a web server instead of using the Firefox emulator, run: ./tools/runserver.
This will start a local python HTTP server on port 8092.

Running gulp will:

  • convert the JSX React source which lives inside js/ and put it inside /build.
  • Convert the LESS stylesheets in style/less into CSS and store it in /build/css
  • Run lint on the source files
  • Start watching for changes and will re-run all of that again when changes are made.

Running tests

Run ./tools/runserver and load ./test/test.html in Firefox. Or just run ./tools/runtests.

For now, it's best to run the tests in a fresh restart of the browser in private browsing mode so you can be sure no files are cached. This is currently known to happen for some localization files with the simple python HTTP server otherwise.

The first time you run tests, the APIClient.init test may take a while because it fetches the topic tree and may not be cached on the KA servers.

Storage

Device Storage API is used for downloads and for cached topic trees.
It is sometimes useful to clear this data while using a simulator.
You can find this storage when using a simulator in a location similar to this: /Users/brianbondy//Library/Application Support/Firefox/Profiles/s9r03lep.default-1410874219924/extensions/[email protected]/profile/fake-sdcard/

Your exact path will differ depending on your OS, your profile, and the simulator being used.

Some other storage for smaller cached values is used with local storage. You can clear that simply by opening the console and executing: localStorage.clear();

ADB commands

For OOM failures, check for sigkill being sent to app. The size is listed in pages (4 KB/page).

adb shell dmesg | tail -20

Branches

There are 2 main branches. One with AMD module loading (requirejs) and one for CommonJS (using webpack) . Master is based on the webpack version but is not currently stable yet.

Contribute

Please feel free to contribute directly by adding pull requests and issues through github. If you would like help getting setup feel free to contact Brian R. Bondy

Contributors

khan-academy-fxos's People

Contributors

bbondy avatar caos30 avatar farezv avatar rsertelon 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

Watchers

 avatar  avatar  avatar  avatar

khan-academy-fxos's Issues

Default playback speed on the video page

Have a way to set the default playback speed on the video page.
Both for slower and faster.

This may be a solution around bad buffering for large videos (play it at half speed is better than having it stall always).

No way to navigate back from video playback page

I found no way to navigate back to the main home page of the app (using localhost in Firefox or the OS simulator) after traversing through topics to end up on a video page like this. Is there a UI element that we could add to navigate back?

screen shot 2014-10-18 at 5 05 31 pm
screen shot 2014-10-18 at 5 11 19 pm

Better full screen mode experience

We can't auto set full screen on an html5 video

It may be better to have our own custom full screen mode which is just a new view and have overlay controls since we're already full screen anyway.

Make settings pane scrollable

Reset button slightly gets cut off on landscape mode. Not a big deal since you can still click it but as we add more settings it'll be a problem.

Support 256MB of RAM

  • Downloading of a video on 256mem device crashes KA program because of low men probably.
  • warn about lowmem devices if not enough room like detect < 512MB of RAM and give an alert that it probably won't work
  • Playing downloaded files crashes whole OS on 256mem device

Add exercises

Earn points and then somehow replay them to the server when the user goes online.

Refactor downloaded content code

Refactoring use of downloaded content, currently the view code uses Storage directly and it should instead use a new Downloads.getContent or something

Keep current model state when showing panes

View video, press back, transcript refreshes, shouldn’t need to refresh there.
Ideally we'd have the VideoViewer control still there but just not showing so that we don't need to get the transcript again on init.

I'd rather not store it on the model for less memory usage.

Larger videos are impossible to watch because of bad buffering

Tried reaching out to some mozilla devs, got some suggestions but nothing helped enough to fix this.
Wish there was a per app way to say how aggressive the buffering should be.

nasa mission control video is impossible to watch because it’s really choppy, pausing doesn’t help.

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.