Return to site

Mitch 1 6 3 – Lightweight Native Twitch App

broken image


SyncTube

Synchronized video viewing with chat and other features.Lightweight modern implementation and very easy way to run locally.

  • If you use a webcam on your Windows 10 PC then you'll need, well, something, to work alongside it and capture your photos, videos and streams, or power your conference calls. These are some of our.
  • Twitch is a very useful app for anyone who frequently uses this service, which you can now carry with you at all times. It's important to keep in mind that THIS is the new version of the Twitch app and that the previous one (version 3.2.3) no longer has official support.

The Twitch app now has addon management built in, so you can browse for new addons, install them, and keep them up to date with a fresh interface and streamlined support from Twitch. Experience new adventures with some of the most popular modpacks, such as the massive FTB pack, the challenging Agrarian Skies or Direwolf20's customized pack, all.

Default channel example: http://synctube-example.herokuapp.com/

New features

  • Reworked layout and theme
  • Multi-Language support
  • Hotkeys (Alt-P for global play/pause, etc)
  • Mobile view with page fullscreen
  • Way to play local videos for network users (without NAT loopback feature)
  • Playback rate synchronization (with leader)
  • /30, /-21, etc to rewind video playback in seconds
  • Links mask: foo.com/bar${1-4}.mp4 to add multiple items
  • Override every front-end file you want (user/res folder)

Supported players

  • Youtube (videos, streams and playlists)
  • Raw mp4 videos and m3u8 playlists (or any other media format supported in browser)
  • Iframes (without sync)

Setup

  • Open 4200 port in your router settings (port is customizable)
  • npm install ws in this project folder (NodeJS required)
  • Run node build/server.js
  • Open showed 'Local' link for yourself and send 'Global' link to friends

Configuration

It's just works, but you can also check user/ folder for server settings and additional customization.

Plugins

  • octosubs - ASS/SSA subtitles support
  • qswitcher - raw video quality switcher

How to use

  • Login with any nickname
  • Add your video url with 'plus' button below (youtube or direct link to mp4 for example)
  • Now it plays and syncs for all page users, well done
  • You can click 'leader' button to get access to global video controls (play/pause, time setting, playback speed)
  • If you want to restrict permissions or add admins/emotes, see Configuration above

Intergations

Lightweight

Heroku:

  • Create app and commit repo to get build
  • Remove user/ folder from .gitignore and commit it to change default configuration
  • Add APP_URL config var with your-app-link.herokuapp.com value to prevent sleeping when clients online

Development

  • Install Haxe 4.1, VSCode and Haxe extension
  • haxelib install all to install extern libs
  • If you skipped Setup section before: npm install
  • Open project in VSCode and press F5 for client+server build and run

About

Mitch 1 6 3 – Lightweight Native Twitch App Create

  • Layout and design by Austin Riddell
  • Original idea by Calvin Montgomery
  • Default emotes by emlan

Introduction

In the Android 2.3.7 release, Intel and Google announced that they would work to enable and optimize future versions of Android to run native applications on x86 (Intel® architecture (IA))

But releasing and packaging Android NDK apps is important to developers who want to deliver better performance and user experience on each architecture. This article introduces some existing options to package Android NDK applications by analyzing some specific example applications chosen from Google Play. You can choose the most suitable option for your Android NDK application.

Mitch 1 6 3 – Lightweight Native Twitch App Setup

Options to release Android NDK apps

Table 1. Options to release Android NDK Apps

As shown in Table 1, there are generally four options for releasing Android NDK apps. They are marked with two colors. In green are Single APK and Multiple APKs, which are basic options in Google Play. Actually, those two can cover all app releases. But as you know, Android is a very open and flexible operating system. There are some special options marked with yellow: Separate APK and Tricky APK. Neither is an official Google Play option.

First, we want to explain how to analyze each option from the perspective of providing better x86 support. In the following sections, we will list 'Advantages,' 'Disadvantages,' 'Potential Risks,' and 'How to Avoid Risk' specific to x86.

Potential Risk are events that could happen if the developer adopts this option. These are based on real cases. We will also explain how to avoid the potential risk in your application.

Single APK

Table 2. Single APK Features

TypeDetail
Advantages1. Always supports the latest version of x86.
2. Commonly found in app stores.
DisadvantagesThe APK file size is large, thus taking up more memory.
Potential RisksMay lose the lib file in /lib/x86 when the app integrates a new component that doesn't support x86.
How to Avoid RisksBoth developers and app stores need to validate app on x86 devices before going public.

Google encourages developers to develop and publish Single APK apps that support as many device configurations as possible. Definitely, the Single APK is the best and easiest option to support x86 with the latest version, indeed it is the most common option found in the app stores. But the binary will be larger.

Potential risk is that the application may lose library files when the application integrates a new component, possibly from a third party, which still does not support x86. In this case, the application will crash when launched and the system reports an error that a library file can't be found. To avoid the risk, both developers and app stores need to validate apps on IA devices before the apps are published.

The application example is Sina Weibo, which packages all the native library files together as shown in the following screen shot.


Figure 1. Sina Weibo NDK Libs

Single APK is very suitable for lightweight NDK apps, like Sina Weibo. The total size of the four files making up the x86 library is only 235 KB, which is negligible compared to the 20 files in APK totaling 809 KB before being compressed.


Figure 2. File size of Sina Weibo x86 Libs

Multiple APKs

Table 3. Multiple APKs Features

TypeDetail
Advantages1. Smaller APK size.
2. Always supports x86.
3. Commonly found in app stores.
DisadvantagesJust supported by Google Play
Potential RisksA third-party app store may incorrectly push an X86-based APK to an ARM phone causing it to crash
How to Avoid RisksThe app should do CPU checking before loading native lib.

The Multiple APK option allows developers to publish different APKs for the application, each targeted to a specific device configuration, especially CPU architectures. Each APK must have the same package name but can be an independent version and a different file size.

Here is a screen shot of Chrome* for Android from Google Play. We can see that sizes and versions vary depending on the device.


Figure 3. Chrome* for Android* on Google Play

Multiple APKs have many advantages. The size of APK file downloaded to the device is smaller than the Single APK, which will save users time and reduce network traffic. Users can always get the x86 native version. And users can easily find the x86 APK since each APK shares the same application listing in Google Play. It seems to be a perfect solution. However, only Google Play supports it; most third-party app stores don't.

The Potential Risk is that a third-party app store may incorrectly push the x86 APK to an ARM phone because x86 APK is considered wrongly by the 3rd app stores as an update version of ARM. The reason is that the version code of the x86 APK is a higher number than the ARM APK(for more detail about the version code rule, see: http://software.intel.com/en-us/articles/google-play-supports-cpu-architecture-filtering-for-multiple-apk). When the user launch this app, a crash will happen.

The best way to avoid this risk is for developers to add CPU checking to their apps before loading the native library. If the CPU architecture of target device doesn't match the APK, a message box will pop up and notify users to download the right version.

The best solution is that for all app stores to support Multiple APKs. Then everything will work as it should.

Separate APKs

Table 4. Separate APK Features

TypeDetail
Advantages1. Smaller APK size than Single APK.
2. Good option for developers since all app stores don't support Multiple APKs.
Disadvantages1. x86 version is hard to find in the app stores.
2. Users may be confused by too many app versions.
Potential RisksARM version may still be installed by users with x86 devices.
How to Avoid RisksThe app adds CPU checking before loading native lib and guides users to install the right version.

The most important difference between Separate APK and Multiple APKs is the package name. Here is an example app, UC Browser. We can see that there is 'x86' postfix in the package name of UC Browser(X86). And the Android system considers them two different apps.


Figure 4. Package Name of UC Browser

Developers like this solution because they don't need to maintain the x86 branch for every app version. Because the mobile internet is changing quickly, the develops have to update their mobile apps very frequently to keep up with the latest trends, but the engineering resources of the developers are limited. Separate APKs is a trade-off that allows developers to put a minimum of effort to support more architectures. The disadvantage is that the x86 version is hard to find because it is rarely downloaded as a new app.

The potential risk is that the ARM version may still be installed by users who don't know the difference between x86 and ARM. If the app adds CPU checking before loading the native library, it will avoid this risk and guide users to download the right version.

In the long term, Separate APKs is just a temporary work-round solution and will disappear when more app stores complete Multiple APKs support.

Tricky APK

Table 5. Tricky APK Features

TypeDetail
Advantages1. Smaller APK size than Single APK.
2. Best performance on each CPU-based device.
Disadvantages2-step installation
Potential RisksN/A
How to Avoid RisksN/A

Tricky APK is a special option. The basic idea is to download the native library in two steps. You can think of this option as an update mechanism that is controlled by application itself.

MoboPlayer is an example application that uses the Tricky APK solution. Smart scroll 4 1. More information is in the following screen shot.


Figure 3. 2-step installation of MoboPlayer NDK libs

MoboPlayer is an Android multimedia player that is based on the FFMPEG open source project. It‘s based on Single APK. At the beginning, the user just downloads an app without having to download cumbersome NDK library files. When the user first runs this app, it will check CPU type and then the app will guide the user to download the binary best optimized for the CPU architecture so that user can get maximum performance.

Summary

Several solutions are available for packaging and releasing Android NDK apps. As a developer, you should fully understand your application, especially the native code part. What is your priority? Better performance and power? APK size? Effort to support multiple CPU architectures? etc. At the same time, you should avoid the potential risk of downloading the wrong APK by adding CPU checking to your code in order to load the correct native library. Include exception handling and user guidance in case an application-APK mismatch occurs. The end goal is to deliver the best user experience on all CPU architectures.

Related Links and Resources

To learn more about Intel tools for the Android developer, visit Intel® Developer Zone for Android.

References

Mitch 1 6 3 – Lightweight Native Twitch App Hack

Copyright © 2013 Intel Corporation. All rights reserved.

Mitch 1 6 3 – Lightweight Native Twitch App Online

*Other names and brands may be claimed as the property of others.





broken image