VideoView that plays video only when :eyes: are open and :boy: is detected with various other features

Overview

LookAtMe

API Android Arsenal LookAtMe AwesomeAndroid Android Weekly Android Dev Digest Android Sweets Download Android-Tutorial-Online

VideoView that plays video only when ๐Ÿ‘€ are open and ๐Ÿ‘ฆ is detected with various other features

GIF

AndroidPub (Medium) Post

You can read the AndroidPub post about this library, the perks it provides and other details here.

Screenshots

screenshot_2019-01-10-07-02-17-959_com pd trackeye screenshot_2019-01-10-07-02-22-894_com pd trackeye

Prerequisites

Add this in your root build.gradle file (not your module build.gradle file):

allprojects {
		repositories {
			...
			maven { url 'https://www.jitpack.io' }
		}
	}

Dependency

Add this to your module's build.gradle file (make sure the version matches the JitPack badge above):

dependencies {
	        implementation 'com.github.Pradyuman7:LookAtMe:Version1.0'
}

For latest release, please check the JitPack version and match it with the dependency.

dependencies {
	        implementation 'com.github.Pradyuman7:LookAtMe:Version2.0'
}

Usage

LookAtMe is very easy to use and can be directly used in your application. You just need to first declare the LookAtMe variable in your activity, and add the following in layout of your activity (XML file).

        private LookAtMe lookAtMe;
        lookAtMe = findViewById(R.id.lookme);
	<com.pd.lookatme.LookAtMe
        	android:id="@+id/lookme"
        	android:layout_width="match_parent"
        	android:layout_height="250dp" />

After this, just initiallise LookAtMe variable with the activity context, add the video URI, start the video and just call setLookMe(), the whole code would look something like this:

        lookAtMe.init(this);
        lookAtMe.setVideoURI(Uri.parse("android.resource://" + getPackageName() + "/" + R.raw.videoplayback));
	// lookAtMe.setVideoPath("http://website.com/video/mp4/62000/62792m.mp4"); to use video from a url
        
	lookAtMe.start();
        lookAtMe.setLookMe();

You can also personalise the experience according to your need, using init(). In this method you can add if you want the eye-tracking mode to be FAST or ACCURATE, and also which camera to use, front or back. The method bodies look like this:

	public void init(Context activityContext, String mode, String cameraFace){
        	// add mode to be fast or accurate and cameraFace to be front or back
    	}
	public void init(Context activityContext, String mode){
        	// add mode to be accurate or fast   
    	}

Version2.0 additions

Now in Version2.0 the developer can also access that if the user laughed / smiled during the video. For this, just use this initWithSmilingStatus() method instead of the normal init() like this:

	lookAtMe.initWithSmilingStatus(this); // for smiling status of the user

To access if the user smiled during the video after this, currently you have to acess the log of the app programatically. Currently, LookAtMe counts when user smiles and for how many frames. If the user smiles for 100 frames in total, LookAtMe logs a line stating that "the user smiled for 100 Frames!". After that count resets to 0.

You can access the log of your android app like this:

	try {
  		Process process = Runtime.getRuntime().exec("logcat");
  		BufferedReader bufferedReader = new BufferedReader(
  		new InputStreamReader(process.getInputStream()));

  		StringBuilder log = new StringBuilder();
  		String line = "";
  		while ((line = bufferedReader.readLine()) != null) {
	    		log.append(line);
  		}
  		TextView tv = (TextView)findViewById(R.id.textView1);
  		tv.setText(log.toString());
  	} 
	catch (IOException e) {}

To know more about this, please refer this link.

Pull Request

Have some new ideas or found a bug? Do not hesitate to open an issue and make a pull request.

License

LookAtME is under License: Apache. See the LICENSE file for more info.

Credits

The video being played in the android app is owned solely by Pixar animations and the author lays no claim over the video.

You might also like...
Auxio is a local music player with a fast, reliable UI/UX without the many useless features present in other music players
Auxio is a local music player with a fast, reliable UI/UX without the many useless features present in other music players

Auxio A simple, rational music player for android. FAQ | Licenses | Contributing | Architecture About Auxio is a local music player with a fast, relia

Fermata Media Player is a free, open source audio and video player with a simple and intuitive interface.

Fermata Media Player About Fermata Media Player is a free, open source audio and video player with a simple and intuitive interface. It is focused on

NOVA is an open source video player for Android

NOVA: opeN sOurce Video plAyer Overview NOVA is an open source video player for Android. It consists in a fork of the original Archos Video Player Com

Audio Tagger library for Flutter (Android only)

audio_tagger A Flutter (Android only) plugin for editing and extracting information from your music, at the moment it only works on AAC and OGG (last

Simple and lightweight, yet polished and powerful Android video player based on ExoPlayer
Simple and lightweight, yet polished and powerful Android video player based on ExoPlayer

Just (Video) Player Android video player based on ExoPlayer It uses ExoPlayer's extension-ffmpeg with all its audio formats enabled (it can handle eve

Is an All in One app for Muslims with lots of features such as Prayer Times & Adhan, Collections of Dhikr and Prayer sourced from Authentic Hadith, The Holy Qur'an, Qibla, Notes and many more!
Is an All in One app for Muslims with lots of features such as Prayer Times & Adhan, Collections of Dhikr and Prayer sourced from Authentic Hadith, The Holy Qur'an, Qibla, Notes and many more!

Is an All in One app for Muslims with lots of features such as Prayer Times & Adhan, Collections of Dhikr and Prayer sourced from Authentic Hadith, The Holy Qur'an, Qibla, Notes and many more!

Custom Android view with video player, loader and placeholder image
Custom Android view with video player, loader and placeholder image

VideoPlayerView Custom Android view with video player, loader and placeholder image. To stay up-to-date with news about the library Usage Here is an e

VideoTimelineView - A TimelineView implementation for video cut and trim operation
VideoTimelineView - A TimelineView implementation for video cut and trim operation

VideoTimelineView A TimelineView implementation for video cut and trim operation

 An offline music player android app, with modern UI and powerful features
An offline music player android app, with modern UI and powerful features

Pulse Music An offline music player android app, with modern UI and powerful features If you liked this repo, fork it and leave a STAR. Your support m

Comments
  • Adding seekbar in videos

    Adding seekbar in videos

    Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

    Describe the solution you'd like A seekbar should be added in video view so that it will be easy for user to reach at any position of video.

    opened by Satya-Prakash0 0
  • Make it easy to access the smiling status without accessing the log

    Make it easy to access the smiling status without accessing the log

    Currently in LookAtMe Version2.0, app developer has to access the log to know if user smiled for 100 frames. This should be made a lot easier, and needs work and updates.

    enhancement Working Update Needed 
    opened by Pradyuman7 0
  • Make a customisable AdView using the same technology

    Make a customisable AdView using the same technology

    Make a clear, customisable android AdView using the same concepts

    An AdView would definitely be a great way to show ads to the user and know if the user really saw the ad or just flipped it for nothing.

    help wanted Feature 
    opened by Pradyuman7 5
  • Track the eyeball, to accurately know if the user is looking at the video or something just beside the screen

    Track the eyeball, to accurately know if the user is looking at the video or something just beside the screen

    The library currently tracks if the user is watching the video or not by taking a look if the eyes are open and the face is detected, but accuracy would be to track if the eyeballs are focussing on the video or something beside the screen.

    Working on adding the eyeball focussing in the library, making it truly know if the user is paying attention to the video.

    Feature Working 
    opened by Pradyuman7 0
Releases(Version2.0)
  • Version2.0(May 15, 2019)

    This release of LookAtMe 2.0 gives developer access to smiling status of the user to find if user laughed / smiled / liked the video content.

    Current issue is that the developer has to access log data programatically in another thread to get the status of the user smiling. Working on resolving this issue for Release 2.1

    Source code(tar.gz)
    Source code(zip)
  • Version1.0(Mar 4, 2019)

    The very first release of LookAtMe, an android library for a VideoView that continually tracks eyes and detects face to play video only when eyes are open and face is present.

    Source code(tar.gz)
    Source code(zip)
Owner
Pradyuman Dixit
I code.
Pradyuman Dixit
To play video on layout background (textureview videoview for layout designs)

The normal videoview on Android is very costly in terms of performance. Also, due to the video resolution ratio and apk size, most developers don't want to include videos in the project. With this library, developers will have a performance-friendly video background with a few lines of code.

Egemen ร–ZOGUL 324 Nov 29, 2022
A Spotify Clone that plays music and has similar UI to actual Spotify Mobile App. Made with Exoplayer and love โค๏ธ

Spotify Clone A Spotify Clone App that can play music, and has a good looking UI that is very similar to actual Spotify Mobile App on Play Store I use

Utku Oruรง 4 Oct 12, 2022
Android Texture VideoView having a variety of scale types like the scale types of ImageView such as fitCenter, centerCrop, centerTopCrop and more

Android-ScalableVideoView Looking for the extra scale types of ImageView? Check out ScalableImageView. Android Texture VideoView having a variety of s

Yoshihito Ikeda 1.1k Jan 7, 2023
Android Application that plays music through a Spotify API based on a user's current location found through Google Maps API and also checking Google Weather API.

GeoStereo Android Application that plays music through a Spotify API based on a user's current location found through Google Maps API and also checkin

Jonah Douglas 1 Jun 16, 2022
Cache wrapper for standart android VideoView

Android VideoView cache Cache wrapper for standart android VideoView It uses okhttp and rxjava inside. Nothing special is needed to use. Setup: Add ma

Andrew0000 4 Aug 25, 2022
Video Transcoder is an application which uses the open source program FFmpeg to transcode video files from one format to another.

Video Transcoder Do you want to encode videos on your phone into different formats, trim videos, or extract audio? Are you looking for a free solution

Branden Archer 358 Dec 30, 2022
Free p2p cdn android github sdk to reduce video streaming costs of live and on demand video using webrtc by upto 90% and improve scalability by 6x - ๐Ÿš€ Vadootv ๐Ÿš€

Android p2p cdn sdk to distribute load and reduce costs(https://peervadoo.com) Vadootv is a p2p sdk integration to reduce your video streaming costs b

Vadootv 40 Oct 5, 2022
Yet Another Video Player (or YAVP) is a Video Player for Android that is based on Googles ExoPlayer.

Yet Another Video Player Yet Another Video Player (or YAVP) is a Video Player for Android that is based on Googles ExoPlayer. Who Is YAVP For? First o

null 62 Dec 29, 2022
Compose-video-player - Video player for Android Compose powered by ExoPlayer

Compose Video Player Video player for Android Compose powered by ExoPlayer. Addi

Juan Pablo Herrera 22 Dec 13, 2022
The Madman library (Media Ads Manager) enables you to advertise video contents with video ads.

Madman (Media ads manager) is a high performance alternative to Google's standard IMA android SDK. If you have your own VAST server and want to render video ads and have full control over the UI, then this library is for you.

Flipkart Incubator 65 Nov 10, 2022