Giter VIP home page Giter VIP logo

smartyoutubetv's Introduction

Smart YouTube TV

Imagine that you have ordinary Chinese android box with simple remote controller. What YouTube client you should use? Regular client doesn't understand remote controller. Off course you may use official YouTube TV client for Nexus Player. But there is many drawback. One of them is dependencies (e.g. gapps) that box usually don't have. Another drawback is that official client needs minimum Android 5.0. And there comes Smart YouTube TV. It require zero dependencies, minimum Android 4.4.

Highlights

  • consist of two parts: app and standalone browser engine:
    • smartyoutubetv: main app that using browser engine for rendering
    • browser: engine with wide capabilities (e.g. display naked page)
  • browser engine can be used independently (currently in development)
  • browser engine based on marshmallow-release branch of android open source project

Quick start

To build project navigate to the root directory then type:

gradlew build

Generated apks will be placed in the directory ./smartyoutubetv/build/outputs/apk/

Browser engine usage

Basic usage

MyActivity extends MainBrowserActivity {
	@Override
	void onCreate(Bundle bundle) {
		super.onCreate();
		Controller controller = new SimpleUiController(this);
		controller.loadUrl("http://ya.ru");
		setController(controller);
	}
}

More lifecircle handling and custom engine usage

MyActivity extends MainBrowserActivity {
	MyActivity() {
		// set preferred engine to XWalk (default - WebView)
		// we must set engine as early as possible
        Browser.setEngineType(EngineType.XWalk);
	}
	@Override
	void onCreate(Bundle bundle) {
		Controller controller = new SimpleUiController(this);
		Intent intent = (bundle == null) ? getIntent() : null;
		controller.start(intent, "http://ya.ru");
		setController(controller);
	}
}

Benefits of this browser engine over regular WebView

  • ability to choose preferred engine type: WebView, XWalk
  • you don't have to deal with creating custom methods for managing WebView lifecircle (pause, resume etc)
  • ability to easily add tabs, settings and other regular browser-specific features
  • all internal state is saved into persistent memory instead of RAM

Used libraries

  • Crosswalk - alternative browser engine
  • Otto - message bus
  • OkHttp - http processing
  • Android Logger - logger factory implementation
  • Crashlytics - multipurpose crash analytics
  • Butter Knife - simplify layout handling

Crashlytics

Version name, code and package will be loaded from gradle build script. Crashlytics credentials can be controlled from fabric.properties file.

app/fabric.properties

apiSecret=7c9df6d057e7bb62b17ab364e8115a75fcf7430873b6274bb094d1a8adb
apiKey=cc238b2a4866ceb061b008839cdb49a8b77

You can get apiSecret and apiKey from the fabric dashboard fabric.io/settings/organizations where they were created after successful first-time signup with Crashlytics plugin GUI for Android Studio.

TODO

  • exo: fix play from phone (because main app not running: mobizen_20170929_111409.mp4)
  • exo: add 'share' button
  • subtitle support

Proposition list

  • playlist: more informative playlist layout
  • playlist: add shuffle option
  • video-item: add comments section
  • video-item: add description section

DONE

  • XWalk: remember selected resolution
  • XWalk: add 4k version
  • auto update
  • live video > select higher quality
  • beta: remember selected resolution
  • exo: tune rewind step from 1min to 15 sec
  • auto update
  • exo: fix brightness (-webkit-filter:brightness(0))
  • market: add to aptoide
  • select version on launch
  • System.exit(0)
  • add 60 fps support
  • auto clear cache to maintain small footprint
  • disable release logging
  • bug with Resuming webview timers
  • ability to set video quality
  • adapt build system to multiple prduct flavors
  • add Crashlytics crash reporting tool
  • add Crosswalk backend
  • apply codec fixes: MiTV3, MiTV3S-55, X92
  • add DIAL (DIscovery And Launch) support
  • add adblock
  • add crash handler
  • handle intents from external apps
  • restore state (Bundle) when app unloaded from memory
  • back key not closes video but exits from app
  • don't play video in background
  • keys not working
  • add wide viewport
  • fix constant activity reload
  • remove ActionBar
  • add system wide logging

NOTES

Other

  • how to fetch sources from android open source project via console:
    • git clone -b marshmallow-release https://android.googlesource.com/platform/packages/apps/Browser

smartyoutubetv's People

Contributors

javierpz avatar maikell84 avatar thermaverick avatar yuliskov avatar

Watchers

 avatar  avatar  avatar

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.