Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

webrtc-streaming-core

Package Overview
Dependencies
Maintainers
1
Versions
65
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webrtc-streaming-core - npm Package Compare versions

Comparing version 1.1.5 to 1.1.6

23

dist/gui/hid.d.ts

@@ -0,1 +1,22 @@

declare class TouchData implements Touch {
constructor(initial: Touch);
copyFromTouch(touch: Touch): void;
clientX: number;
clientY: number;
force: number;
identifier: number;
pageX: number;
pageY: number;
radiusX: number;
radiusY: number;
rotationAngle: number;
screenX: number;
screenY: number;
target: EventTarget;
readonly touchStart: Touch;
doMove: boolean;
holdTimeout: number;
leftMouseDown: boolean;
startTime: Date;
}
export declare class HID {

@@ -33,2 +54,3 @@ private prev_buttons;

handleMove(evt: TouchEvent): void;
handle_swipe(touch: TouchData): void;
handleEnd(evt: TouchEvent): void;

@@ -38,1 +60,2 @@ handleCancel(evt: TouchEvent): void;

}
export {};

@@ -7,2 +7,4 @@ "use strict";

const keys_model_2 = require("../models/keys.model");
const thresholdTime = 500;
const thresholdDistance = 100;
class TouchData {

@@ -25,2 +27,3 @@ constructor(initial) {

this.leftMouseDown = true;
this.startTime = new Date();
this.touchStart = {

@@ -351,2 +354,36 @@ clientX: initial.clientX,

}
handle_swipe(touch) {
const now = new Date().getTime();
const deltaTime = now - touch.startTime.getTime();
const deltaX = touch.clientX - touch.touchStart.clientX;
const deltaY = touch.clientY - touch.touchStart.clientY;
/* work out what the movement was */
if (deltaTime > thresholdTime) {
/* gesture too slow */
return;
}
else {
if ((deltaX > thresholdDistance) && (Math.abs(deltaY) < thresholdDistance)) {
// o.innerHTML = 'swipe right';
}
else if ((-deltaX > thresholdDistance) && (Math.abs(deltaY) < thresholdDistance)) {
// o.innerHTML = 'swipe left';
}
else if ((deltaY > thresholdDistance) && (Math.abs(deltaX) < thresholdDistance)) {
// o.innerHTML = 'swipe down';
this.SendFunc((new keys_model_2.HIDMsg(keys_model_1.EventCode.MouseWheel, {
deltaY: -120
})).ToString());
}
else if ((-deltaY > thresholdDistance) && (Math.abs(deltaX) < thresholdDistance)) {
// o.innerHTML = 'swipe up';
this.SendFunc((new keys_model_2.HIDMsg(keys_model_1.EventCode.MouseWheel, {
deltaY: 120
})).ToString());
}
else {
// o.innerHTML = '';
}
}
}
handleEnd(evt) {

@@ -363,2 +400,3 @@ evt.preventDefault();

}
this.handle_swipe(touch);
this.onGoingTouchs.delete(touches[i].identifier);

@@ -372,2 +410,8 @@ }

for (let i = 0; i < touches.length; i++) {
const touch = this.onGoingTouchs.get(touches[i].identifier);
if (touch.leftMouseDown) {
this.SendFunc((new keys_model_2.HIDMsg(keys_model_1.EventCode.MouseUp, {
button: '0'
})).ToString());
}
this.onGoingTouchs.delete(touches[i].identifier);

@@ -374,0 +418,0 @@ }

2

package.json
{
"name": "webrtc-streaming-core",
"version": "1.1.5",
"version": "1.1.6",
"description": "",

@@ -5,0 +5,0 @@ "main": "dist/app.js",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc