1.1.4 • Published 2 years ago

@elitefit/elitepose v1.1.4

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

ElitePose

EliteFit SDK.

Installation

npm install @elitefit/elitepose

Usage

import {ElitePose,EliteService} from '@elitefit/elitepose';

//instantiate the eliteservice. and pass in accesstoken for
//authorization
const getAccessToken = () => localStorage.getItem('token');
const eliteService = new EliteSevice({
    authToken: getAccessToken,
});

//Getting videoInfo
const videoData = await eliteService.getVideoInfo(this.videoId);
this.steps = this.videoInfo.data.steps;

//instantiate the ElitePose. and pass in customization options
this.elitePose = new ElitePose(this.eliteService, {
    onResult: (data) => {
        this.instanceScore = data.instanceScore;
        this.calorieBurnt = data.calorieBurnt;
        this.avgAccuracy = data.avgAccuracy;
    }
});

//initialse the camera and pass in the element references and video details.
await this.elitePose.initCamera(
    this.$refs.userVideo,
    this.$refs.canvas,
    this.$refs.youtube.player,
    this.videoId,
    this.steps,
    this.efTech
);