mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-19 11:21:20 -08:00
refactor: optimize component lifecycle and build process
- React: Removed unnecessary dependencies from useEffect in Artplayer component. - Vue: Simplified instance emission in Artplayer component by removing nextTick. - Build script: Added cpy to copy built i18n files to a new directory and set context to browser for Parcel.
This commit is contained in:
1 parent
0eed9c114b
commit
5cc6724f54
17 files changed
+25
-19
No files matched your search
+5
-1
@@ -17,7 +17,8 @@
|
||||
"imports": {
|
||||
"artplayer": "/compiled/artplayer.mjs",
|
||||
"artplayer-plugin-danmuku": "/compiled/artplayer-plugin-danmuku.mjs",
|
||||
"artplayer-plugin-document-pip": "/compiled/artplayer-plugin-document-pip.mjs"
|
||||
"artplayer-plugin-document-pip": "/compiled/artplayer-plugin-document-pip.mjs",
|
||||
"id": "/compiled/i18n/id.mjs"
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -29,10 +30,13 @@
|
||||
import Artplayer from 'artplayer';
|
||||
import ArtplayerPluginDanmuku from 'artplayer-plugin-danmuku';
|
||||
import ArtplayerPluginDocumentPip from 'artplayer-plugin-document-pip';
|
||||
import id from 'id';
|
||||
|
||||
const art = new Artplayer({
|
||||
container: '#player',
|
||||
url: '/assets/sample/video.mp4',
|
||||
i18n: { id },
|
||||
lang: 'id',
|
||||
plugins: [
|
||||
ArtplayerPluginDocumentPip(),
|
||||
artplayerPluginDanmuku({
|
||||
|
||||
Reference in new issue
Block a user