react-video-annotation-tool
Version:
A React-based video player with built-in annotation features, enabling interactive video tagging and markup for seamless media annotation workflows
38 lines • 1.55 kB
JavaScript
import React, { forwardRef } from "react";
import { Line } from "react-konva";
export var LineShape = /*#__PURE__*/forwardRef(function (_ref, ref) {
var properties = _ref.properties,
color = _ref.color,
draggable = _ref.draggable,
onClick = _ref.onClick,
onDragEnd = _ref.onDragEnd,
onDragStart = _ref.onDragStart,
onTransformEnd = _ref.onTransformEnd,
onTransformStart = _ref.onTransformStart,
onDragMove = _ref.onDragMove,
dragBoundFunc = _ref.dragBoundFunc,
currentWidth = _ref.currentWidth,
currentHeight = _ref.currentHeight,
onMouseEnter = _ref.onMouseEnter;
return /*#__PURE__*/React.createElement(Line, {
ref: ref,
x: properties.x * (currentWidth / properties.screenWidth),
y: properties.y * (currentHeight / properties.screenHeight),
points: properties.points.map(function (point, index) {
return index % 2 === 0 ? point * (currentWidth / properties.screenWidth) : point * (currentHeight / properties.screenHeight);
}),
tension: properties.tension || 0,
stroke: color,
strokeWidth: (properties === null || properties === void 0 ? void 0 : properties.strokeWidth) || 2,
opacity: (properties === null || properties === void 0 ? void 0 : properties.opacity) || 1,
draggable: draggable,
onClick: onClick,
onDragEnd: onDragEnd,
onDragStart: onDragStart,
onDragMove: onDragMove,
onMouseEnter: onMouseEnter,
dragBoundFunc: dragBoundFunc,
onTransformStart: onTransformStart,
onTransformEnd: onTransformEnd
});
});