mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-15 00:56:16 -08:00
1 line
5.3 KiB
JavaScript
1 line
5.3 KiB
JavaScript
"use strict";(self.webpackChunkartplayer_document=self.webpackChunkartplayer_document||[]).push([[342],{3905:function(e,t,n){n.d(t,{Zo:function(){return c},kt:function(){return d}});var r=n(7294);function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){l(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function o(e,t){if(null==e)return{};var n,r,l=function(e,t){if(null==e)return{};var n,r,l={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(l[n]=e[n]);return l}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(l[n]=e[n])}return l}var s=r.createContext({}),u=function(e){var t=r.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},c=function(e){var t=u(e.components);return r.createElement(s.Provider,{value:t},e.children)},p={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},m=r.forwardRef((function(e,t){var n=e.components,l=e.mdxType,a=e.originalType,s=e.parentName,c=o(e,["components","mdxType","originalType","parentName"]),m=u(n),d=l,f=m["".concat(s,".").concat(d)]||m[d]||p[d]||a;return n?r.createElement(f,i(i({ref:t},c),{},{components:n})):r.createElement(f,i({ref:t},c))}));function d(e,t){var n=arguments,l=t&&t.mdxType;if("string"==typeof e||l){var a=n.length,i=new Array(a);i[0]=m;var o={};for(var s in t)hasOwnProperty.call(t,s)&&(o[s]=t[s]);o.originalType=e,o.mdxType="string"==typeof e?e:l,i[1]=o;for(var u=2;u<a;u++)i[u]=n[u];return r.createElement.apply(null,i)}return r.createElement.apply(null,n)}m.displayName="MDXCreateElement"},4531:function(e,t,n){n.r(t),n.d(t,{assets:function(){return c},contentTitle:function(){return s},default:function(){return d},frontMatter:function(){return o},metadata:function(){return u},toc:function(){return p}});var r=n(7462),l=n(3366),a=(n(7294),n(3905)),i=["components"],o={title:"Hls Quality Plugin",sidebar_position:4},s=void 0,u={unversionedId:"en/Plugins/hls-quality",id:"en/Plugins/hls-quality",title:"Hls Quality Plugin",description:"Overview",source:"@site/docs/en/Plugins/hls-quality.mdx",sourceDirName:"en/Plugins",slug:"/en/Plugins/hls-quality",permalink:"/document/en/Plugins/hls-quality",draft:!1,tags:[],version:"current",sidebarPosition:4,frontMatter:{title:"Hls Quality Plugin",sidebar_position:4},sidebar:"en",previous:{title:"Iframe Plugin",permalink:"/document/en/Plugins/iframe"},next:{title:"Add select in the controls",permalink:"/document/en/Questions/Create_selector_in_the_controls"}},c={},p=[{value:"Overview",id:"overview",level:2},{value:"Demo",id:"demo",level:2},{value:"Install",id:"install",level:2},{value:"Install from <code>npm</code>:",id:"install-from-npm",level:3},{value:"Install from <code>yarn</code>:",id:"install-from-yarn",level:3},{value:"Install from <code>script</code>:",id:"install-from-script",level:3}],m={toc:p};function d(e){var t=e.components,n=(0,l.Z)(e,i);return(0,a.kt)("wrapper",(0,r.Z)({},m,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("h2",{id:"overview"},"Overview"),(0,a.kt)("p",null,"With this plugin, you can add the ",(0,a.kt)("inlineCode",{parentName:"p"},"Hls")," video quality list to the control or the settings panel"),(0,a.kt)("h2",{id:"demo"},"Demo"),(0,a.kt)("p",null,"\ud83d\udc49 ",(0,a.kt)("a",{parentName:"p",href:"https://artplayer.org/?libs=https://cdnjs.cloudflare.com/ajax/libs/hls.js/8.0.0-beta.3/hls.min.js%0A./uncompiled/artplayer-plugin-hls-quality/index.js&example=hls.quality"},"View Demo")),(0,a.kt)("h2",{id:"install"},"Install"),(0,a.kt)("h3",{id:"install-from-npm"},"Install from ",(0,a.kt)("inlineCode",{parentName:"h3"},"npm"),":"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-bash"},"$ npm install artplayer-plugin-hls-quality\n")),(0,a.kt)("h3",{id:"install-from-yarn"},"Install from ",(0,a.kt)("inlineCode",{parentName:"h3"},"yarn"),":"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-bash"},"$ yarn add artplayer-plugin-hls-quality\n")),(0,a.kt)("h3",{id:"install-from-script"},"Install from ",(0,a.kt)("inlineCode",{parentName:"h3"},"script"),":"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-html"},'\x3c!-- local --\x3e\n<script src="path/to/artplayer-plugin-hls-quality.js"><\/script>\n\n\x3c!-- jsdelivr --\x3e\n<script src="https://cdn.jsdelivr.net/npm/artplayer-plugin-hls-quality/dist/artplayer-plugin-hls-quality.js"><\/script>\n\n\x3c!-- unpkg --\x3e\n<script src="https://unpkg.com/artplayer-plugin-hls-quality/dist/artplayer-plugin-hls-quality.js"><\/script>\n')),(0,a.kt)("p",null,"Then you can access the plugin function through ",(0,a.kt)("inlineCode",{parentName:"p"},"window.artplayerPluginHlsQuality")))}d.isMDXComponent=!0}}]); |