remove artplayer-plugin-ass

This commit is contained in:
Harvey committed 2021-04-14 15:22:16 +08:00
1 parent 5cdf65d32f
commit 785ad52e60
9 files changed
-132

No files matched your search

-9
View File
@@ -1,9 +0,0 @@
node_modules
.DS_Store
yarn.lock
package-lock.json
test
coverage
.nyc_output
.cache
docs
-1
View File
@@ -1 +0,0 @@
package-lock=false
-47
View File
@@ -1,47 +0,0 @@
# artplayer-plugin-ass
Ass plugin for ArtPlayer, use [weizhenye/ASS](https://github.com/weizhenye/ASS) as a dependency
## Demo
[Checkout the demo](https://artplayer.org/?libs=.%2Funcompiled%2Fartplayer-plugin-ass.js&example=ass) from Github Pages
## Install
Install with `npm`
```bash
$ npm install artplayer-plugin-ass
```
Or install with `yarn`
```bash
$ yarn add artplayer-plugin-ass
```
```js
import artplayerPluginAss from 'artplayer-plugin-ass';
```
Or umd builds are also available
```html
<script src="artplayer-plugin-ass.js"></script>
```
Will expose the global variable to `window.artplayerPluginAss`.
## Usage
```js
var art = new Artplayer({
container: '.artplayer-app',
url: 'path/to/video.mp4',
plugins: [artplayerPluginAss('path/to/subtitle.ass')],
});
```
## License
MIT © [Harvey Zack](https://sleepy.im/)
@@ -1,8 +0,0 @@
/*!
* artplayer-plugin-ass.js v3.5.27
* Github: https://github.com/zhw2590582/ArtPlayer#readme
* (c) 2017-2020 Harvey Zack
* Released under the MIT License.
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("assjs")):"function"==typeof define&&define.amd?define(["assjs"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).artplayerPluginAss=t(e.ASS)}(this,(function(e){"use strict";function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=t(e);return function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===n&&i.firstChild?i.insertBefore(r,i.firstChild):i.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}}(".artplayer-plugin-ass{bottom:0!important}"),function(e){return function(t){var i=null;return fetch(e).then((function(e){return e.text()})).then((function(e){var r=t.template,s=r.$video,o=r.$subtitle;o.classList.add("artplayer-plugin-ass"),t.once("ready",(function(){(i=new n.default(e,s,{container:o,resampling:"video_width"})).resize(),t.emit("artplayerPluginAss",i),t.on("resize",(function(){return i.resize()})),t.on("destroy",(function(){return i.destroy()}))}))})),{name:"artplayerPluginAss",ass:i}}}}));
@@ -1,28 +0,0 @@
{
"name": "artplayer-plugin-ass",
"version": "3.5.27",
"expose": "artplayerPluginAss",
"description": "Ass plugin for ArtPlayer",
"main": "dist/artplayer-plugin-ass.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/zhw2590582/ArtPlayer.git"
},
"keywords": [
"video",
"player"
],
"author": "Harvey Zack <laozhaochaguan@gmail.com>",
"license": "MIT",
"bugs": {
"url": "https://github.com/zhw2590582/ArtPlayer/issues"
},
"homepage": "https://github.com/zhw2590582/ArtPlayer#readme",
"gitHead": "5ea211ef738351668e4acace326af4ff6947e2ee",
"dependencies": {
"assjs": "^0.0.11"
}
}
@@ -1,32 +0,0 @@
import ASS from 'assjs';
import './style.scss';
function artplayerPluginAss(url) {
return (art) => {
let ass = null;
fetch(url)
.then((res) => res.text())
.then((text) => {
const { $video, $subtitle } = art.template;
$subtitle.classList.add('artplayer-plugin-ass');
art.once('ready', () => {
ass = new ASS(text, $video, {
container: $subtitle,
resampling: 'video_width',
});
ass.resize();
art.emit('artplayerPluginAss', ass);
art.on('resize', () => ass.resize());
art.on('destroy', () => ass.destroy());
});
});
return {
name: 'artplayerPluginAss',
ass,
};
};
}
export default artplayerPluginAss;
@@ -1,3 +0,0 @@
.artplayer-plugin-ass {
bottom: 0 !important;
}