remove examples dir

This commit is contained in:
Harvey Zack committed 2022-11-04 20:29:15 +08:00
1 parent 1ca9ffa832
commit 4092b51c4e
3 files changed
+2 -65

No files matched your search

+2 -1
View File
@@ -12,7 +12,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- 新增 `Artplayer.ASPECT_RATIO` 用于设置默认长宽比,默认 `['default', '4:3', '16:9']`
- 新增 `Artplayer.FLIP` 用于设置默认翻转功能,默认 `['normal', 'horizontal', 'vertical']`
- 新增 `Artplayer.PROGRESS_HEIGHT` 用于设置进度条高度,默认为 `4`
- 打包添加 `legacy.js` 版本,用于兼容更老的浏览器,但相对体积较大
- 添加 `legacy.js` 版本,用于兼容更老的浏览器,但相对体积较大
- 移除 `examples` 目录,不再提供 `vue.js` 和 `react.js` 的例子文件
## [4.5.8] - 2022-10-9
- 添加 `farsi` 语言
@@ -1,28 +0,0 @@
import React, { useEffect, useRef } from 'react';
import Artplayer from 'artplayer';
export default function Player({ option, getInstance, ...rest }) {
const artRef = useRef();
useEffect(() => {
const art = new Artplayer({
...option,
container: artRef.current,
});
if (getInstance && typeof getInstance === 'function') {
getInstance(art);
}
return () => {
if (art && art.destroy) {
art.destroy(false);
}
};
}, []);
return React.createElement('div', {
ref: artRef,
...rest,
});
}
@@ -1,36 +0,0 @@
<template>
<div ref="artRef"></div>
</template>
<script>
import Artplayer from 'artplayer';
export default {
data() {
return {
instance: null,
};
},
props: {
option: {
type: Object,
required: true,
},
},
mounted() {
this.instance = new Artplayer({
...this.option,
container: this.$refs.artRef,
});
this.$nextTick(() => {
this.$emit('get-instance', this.instance);
});
},
beforeUnmount() {
if (this.instance && this.instance.destroy) {
this.instance.destroy();
}
},
};
</script>