@alifd/meet-react
Version:
Fusion Mobile React UI System Component
33 lines • 1.29 kB
JavaScript
import { rpx2vw4style as __rpx2vw__ } from "@alifd/babel-runtime-jsx-style-transform";
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
import { __rest } from "tslib";
import React, { createElement, useEffect } from "react";
import { isFunction } from '../utils';
var RichTextImage = function RichTextImage(props) {
var item = props.item,
className = props.className,
src = props.src,
style = props.style,
id = props.id,
onLoad = props.onLoad,
onPlay = props.onPlay,
otherProps = __rest(props, ["item", "className", "src", "style", "id", "onLoad", "onPlay"]);
var handlePlay = function handlePlay() {
if (isFunction(onPlay)) {
onPlay(id);
}
};
useEffect(function () {
if (isFunction(onLoad)) {
onLoad(id);
}
}, []);
return /*#__PURE__*/React.createElement("video", _extends({}, otherProps, {
id: id,
src: src,
style: __rpx2vw__(style),
className: className,
onPlay: handlePlay
}));
};
export default RichTextImage;