1.0.0 • Published 5 years ago
cordova-plugin-gaze v1.0.0
Cordova Plugin Gaze
Eyetracking Plugin for Cordova Projects.
Example Usage
Please run the plugin after deviceReady
.
// Prepare the Gaze View
await cordova.plugins["cordova-plugin-gaze"].prepare();
// Get the Frame Size of the Gaze View (Mobile View Size)
const { height, width } = await cordova.plugins["cordova-plugin-gaze"].frame();
console.log(height, width);
// Start Eye Tracking Test
const { data, file } = await
cordova.plugins["cordova-plugin-gaze"].start("http://techslides.com/demos/sample-videos/small.mp4")
);
console.log('Coordinates:', data);
console.log('File URL:', file);
Plugin Functions
prepare
Initialize the Eye Gaze View. Please run this function before calling other function(s) on this plugin
frame
Get the Height and Width of the Full-Screen View (a.k.a Device Frame Size).
- Output :
height
: The Device Frame Height in Number (Double).width
: The Device Frame Width in Number (Double).
start
Start the Eye Tracking Test and play the video. This Function will required the permission for Microphone, Photos, Camera. The function process as follow :
- Ask for all permission(s)
- Load the Video from the given URL
- Turn on the Front Camera for Eye Tracking
- Show the
Start Button
Once the Start Button
is clicked, the function continue as follow :
- Play the Video with Sound
- Start the Screen Recording
- Start the Audio Recording
- Start recording Gaze Coordinates
- Record the Front Camera AR Video
Once the Video is finished :
- Stop the Video Player
- Stop the Screen Recording
- Stop Front Camera AR Reocrding
- Stop recording Gaze Coordinates
- Output the Front Camera AR Recording to Photos
Output :
data
: The Gaze Coordinate Array in the format of[number, number, number, number]
which equals[X-Axis, Y-Axis, Distance in CM, Time since starting in milliseconds]
file
: The Front Camera AR Recording File Path
1.0.0
5 years ago