3.3.9 • Published 3 years ago

easyplayer-my v3.3.9

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

EasyPlayer.js

简介

EasyPlayer.js H5播放器,是一款能够同时支持HTTP、HTTP-FLV、HLS(m3u8)、WS视频直播与视频点播等多种协议,支持H.264、H.265、AAC等多种音视频编码格式,支持mse、wasm等多种解码方式,支持Windows、Linux、Android、iOS全平台终端的H5播放器,使用简单, 功能强大。

功能说明

  • 支持 MP4 播放

  • 支持 m3u8/HLS 播放;

  • 支持 HTTP-FLV/WS-FLV 播放;

  • 支持 H265编码视频;

  • 支持 RTMP 播放;

  • 支持直播和点播播放;

  • 支持播放器快照截图;

  • 支持点播多清晰度播放;

  • 支持全屏或比例显示;

  • 自带的 flash 支持极速和流畅模式;

  • 自带的 flash 支持 HTTP-FLV 播放;

  • 自动检测 IE 浏览器兼容播放;

  • 支持重连播放;

HTML 集成示例

  • 使用方式

  • 普通集成

copy dist/element/EasyPlayer-element.min.js 到 www 根目录

在 html 中引用 dist/element/EasyPlayer-element.min.js

<!DOCTYPE html>
<html>
  <head>
    <title>easyplayer</title>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta
      content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"
      name="viewport"
    />
    <script type="text/javascript" src="EasyPlayer-element.min.js"></script>
  </head>
  <body>
    <easy-player
      video-url="rtmp://live.hkstv.hk.lxdns.com/live/hks2"
      live="true"
      stretch="true"
    ></easy-player>
    <easy-player
      video-url="http://live.hkstv.hk.lxdns.com/live/hks/playlist.m3u8"
      live="false"
      stretch="true"
    ></easy-player>
    <easy-player
      video-url="http://live.hkstv.hk.lxdns.com/flv/hks.flv"
      live="true"
      stretch="true"
    ></easy-player>
  </body>
</html>
  • vue集成
  npm install @easydarwin/easyplayer --save
  • Vue 集成调用

copy node_modules/@easydarwin/easyplayer/dist/component/EasyPlayer.swf 到 静态文件 根目录

copy node_modules/@easydarwin/easyplayer/dist/component/crossdomain.xml 到 静态文件 根目录

copy node_modules/@easydarwin/easyplayer/dist/component/EasyPlayer-lib.min.js 到 静态文件 根目录

注意: 没有调用会出现无法加载对应插件的报错

在 html 中引用 dist/component/EasyPlayer-lib.min.js

demo

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width,initial-scale=1.0" />
    <link rel="icon" href="<%= BASE_URL %>favicon.ico" />
    <title>EasyPlayer-demo</title>
    <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
    <script src="./EasyPlayer-lib.min.js"></script>
  </head>
  <body>
    <noscript>
      <strong
        >We're sorry but easynvr-token doesn't work properly without JavaScript
        enabled. Please enable it to continue.</strong
      >
    </noscript>
    <div id="app"></div>
    <!-- built files will be auto injected -->
  </body>
</html>

##效果演示

npm.io

  • npm集成
......

<EasyPlayer
  :videoUrl="videoUrl"
  :aspect="aspect"
  live
  @message="$message"
  :fluent="fluent"
  :autoplay="autoplay"
  stretch
></EasyPlayer>

...... ...... import EasyPlayer from '@easydarwin/easyplayer'; ......
components: { EasyPlayer }

源码演示:github-demo

配置属性

参数说明类型默认值
video-url视频地址String-
video-title视频右上角显示的标题String-
poster视频封面图片String-
auto-play自动播放Booleantrue
live是否直播, 标识要不要显示进度条Booleantrue
speed是否显示倍速播放按钮。注意:当live为true时,此属性不生效Booleantrue
loop是否轮播。Booleanfalse
alt视频流地址没有指定情况下, 视频所在区域显示的文字String无信号
muted是否静音Booleanfalse
aspect视频显示区域的宽高比String16:9
isaspect视频显示区域是否强制宽高比Booleantrue
loading指示加载状态, 支持 sync 修饰符String-
fluent流畅模式Booleantrue
timeout加载超时(秒)Number20
stretch是否不同分辨率强制铺满窗口Booleanfalse
show-custom-button是否在工具栏显示自定义按钮(极速/流畅, 拉伸/标准)Booleantrue
isresolution是否在播放 m3u8 时显示多清晰度选择Booleanfalse
isresolution供选择的清晰度 "yh,fhd,hd,sd", yh:原始分辨率fhd:超清,hd:高清,sd:标清-
resolutiondefault默认播放的清晰度Stringhd
decodeWasm强制H265解码(支持:HLS/FLV/WS)Booleanfalse

HTTP-FLV 播放相关属性

注意:此属性只在播放flv格式的流时生效。

属性说明类型默认值
hasaudio是否有音频,传递该属性可以加快启播速度Boolean默认不配置自动判断
hasvideo是否有视频,传递该属性可以加快启播速度Boolean默认不配置自动判断

事件方法

方法名说明参数
video-url触发通知消息type: '', message: ''
ended播放结束-
timeupdate进度更新当前时间进度
pause暂停当前时间进度
play播放当前时间进度
update:loading加载状态回调-
message播放器回调信息-

更多流媒体音视频资源

EasyDarwin开源流媒体服务器:www.EasyDarwin.org

EasyDSS高性能互联网直播服务:www.EasyDSS.com

EasyNVR安防视频可视化服务:www.EasyNVR.com

EasyNVS视频综合管理平台:www.EasyNVS.com

EasyNTS上云网关www.EasyNTS.com

EasyGBS国标GB/T28181服务器:www.EasyGBS.com

EasyRTC视频会议云服务:www.EasyRTC.com

TSINGSEE青犀开放平台:open.TSINGSEE.com

Copyright © www.TSINGSEE.com Team 2012-2021

青犀TSINGSEE

acorn-dynamic-importJSONStreamajvacceptsacornajv-keywordsadd-streamalign-textalphanum-sortansi-htmlansi-escapesany-observableanchor-markdown-headeranymatchansi-regexansi-stylesaprobaarr-flattenarr-diffarray-flattenarr-unionargparsearray-ifyarray-uniquearray-find-indexarrifyarray-unionarray-uniqasapatobassign-symbolsbabel-code-frameasn1.jsasync-eachbabel-helper-builder-binary-assignment-operator-visitorbabel-helper-call-delegatebabel-helper-explode-assignable-expressionbabel-helper-define-mapasyncbabel-helper-function-namebabel-helper-get-function-aritybabel-helper-optimise-call-expressionbabel-helper-hoist-variablesbabel-helper-regexbabel-helper-remap-async-to-generatorbabel-helper-replace-supersbabel-helpersbabel-messagesbabel-plugin-check-es2015-constantsbabel-plugin-syntax-async-functionsbabel-plugin-syntax-async-generatorsbabel-plugin-syntax-exponentiation-operatorbabel-plugin-syntax-object-rest-spreadbabel-plugin-syntax-trailing-function-commasbabel-plugin-transform-async-to-generatorbabel-plugin-transform-es2015-arrow-functionsassertbabel-plugin-transform-es2015-block-scopingbabel-plugin-transform-es2015-block-scoped-functionsbabel-plugin-transform-es2015-computed-propertiesbabel-plugin-transform-es2015-destructuringbabel-plugin-transform-es2015-duplicate-keysbabel-plugin-transform-es2015-for-ofbabel-plugin-transform-es2015-classesbabel-plugin-transform-es2015-function-namebabel-plugin-transform-es2015-literalsbabel-plugin-transform-es2015-modules-amdbabel-plugin-transform-es2015-modules-umdbabel-plugin-transform-async-generator-functionsbabel-plugin-transform-es2015-modules-commonjsbabel-plugin-transform-es2015-object-superautoprefixerbabel-plugin-transform-es2015-spreadbabel-plugin-transform-es2015-template-literalsbabel-plugin-transform-es2015-shorthand-propertiesbabel-plugin-transform-es2015-sticky-regexbabel-plugin-transform-es2015-typeof-symbolbabel-plugin-transform-es2015-unicode-regexbabel-plugin-transform-object-rest-spreadbabel-generatorbabel-plugin-transform-es2015-modules-systemjsbabel-plugin-transform-strict-modebabel-registerbabel-runtimebabel-templatebabel-typesbabel-traversebabel-plugin-transform-regeneratorbabel-plugin-transform-es2015-parametersbailbabel-plugin-transform-exponentiation-operatorbase64-jsbig.jsbinary-extensionsbasebn.jsbody-parserboolbasebluebirdboundarybabylonbalanced-matchbrace-expansionbracesbonjourbrowserify-cipherbrowserify-rsabrowserify-aesbrowserify-versionifybrorandbrowserify-zlibbufferbuffer-frombuffer-indexofbuffer-xorbrowserify-signbrowserslistcaller-callsitebuiltin-status-codescaller-pathbytescacachecallsitescamelcasecache-basecaniuse-dbcamel-casecaniuse-litecall-bindcaniuse-apibrowserify-descharacter-entitiescharacter-entities-legacycamelcase-keyschokidarci-infocharacter-reference-invalidcipher-basechownrchalkclass-utilsclapcli-cursorcli-truncateclean-csscliuicoclonecoacollection-visitcolor-namecode-point-atcollapse-white-spacecolorcolor-convertcolorscolor-stringcolormincommondircomponent-emittercompare-funccolorettecommandercompressiblecompressionconcat-mapconcat-streamconcat-with-sourcemapsconsole-browserifycontent-dispositionconnect-history-api-fallbackconstants-browserifyconsolidateconventional-changelogcontent-typeconventional-changelog-angularconventional-changelog-atomconventional-changelog-codemirrorconventional-changelog-cliconventional-changelog-corebatchconventional-changelog-emberconventional-changelog-eslintconventional-changelog-expressconventional-changelog-conventionalcommitsconventional-changelog-jqueryconventional-changelog-preset-loaderconventional-changelog-videojsconventional-changelog-writerconventional-changelog-jshintcookiecookie-signaturecore-jsconventional-commits-filterconvert-source-mapconventional-commits-parsercopy-descriptorcore-util-iscreate-ecdhcreate-hmaccopy-concurrentlycrypto-browserifycross-spawncss-color-namescreate-hashcss-selectcssesccss-selector-tokenizercss-whatcssnanocssocenter-aligncosmiconfigdargsdate-fnsdateformatde-indentdecode-uri-componentdecamelizedecamelize-keysdcyclistcurrently-unhandleddebugdefine-propertiesdedentdeep-equaldefineddefine-propertydeldepddes.jsdestroydetect-indentdetect-nodedir-globdiffie-hellmandns-equaldns-packetdns-txtdoctocdom-converterdom-serializerdom-walkdomain-browserdomelementtypedomutilsdomhandlerdot-propduplexifyee-firstelectron-to-chromiumellipticemoji-regexemojis-listerror-exelegant-spinnerencodeurlend-of-streamenhanced-resolveentitieses-abstracterrnoes-to-primitivees6-iteratores5-extes5-shimescape-htmles6-mapes6-promisees6-setes6-symbolescaladeescape-string-regexpesprimaes6-weak-mapesrecurseetagesutilsestraverseevent-emittereventsourceeventemitter3evp_bytestokeyexecaexpressexpand-rangeexpand-bracketsextextend-shallowextendextglobfast-deep-equalfast-json-stable-stringifyfaye-websocketfaultfastparseeventsfiguresfind-rootfill-rangefind-upfilename-regexfn-namefinalhandlerfind-cache-dirflattenflush-write-streamfollow-redirectsfor-infor-ownforwardedformatfs.realpathfragment-cachefreshfs-extrafrom2fs-write-stream-atomicfunction-bindget-caller-filegensyncg-statusget-intrinsicget-own-enumerable-property-symbolsget-pkg-repogitconfiglocalget-stdinget-streamget-valuegit-raw-commitsgit-remote-origin-urlgit-semver-tagsgithub-url-from-gitglobglob-basegraceful-fsglob-parentglobalglobbyglobalshandlebarshandle-thinghard-rejectionhashas-ansihas-bigintshas-flaghas-symbolshas-valuehas-valueshash-basehash-sumhash.jshehosted-git-infohmac-drbghome-or-tmphtml-comment-regexhpack.jshtmlparser2http-errorshttp-deceiverhtml-entitieshtml-minifierhuskyhttp-proxyhttp-parser-jshttps-browserifyescopeiconv-liteimport-freshicss-utilsicss-replace-symbolsieee754indent-stringindexes-ofiferrinheritsimage-sizeignoreinterpretinvert-kvinflightimurmurhashindividualipis-absolute-urliniinternal-ipinvariantis-arrayishipaddr.jsis-accessor-descriptoris-alphabeticalis-alphanumericalis-ciis-argumentsis-bigintis-binary-pathis-boolean-objectis-bufferis-callableis-data-descriptoris-date-objectis-directoryis-core-moduleis-decimalis-finitehttp-proxy-middlewareis-equal-shallowis-extendableis-dotfileis-extglobis-fullwidth-code-pointis-objis-hexadecimalis-globis-functionis-path-cwdis-negative-zerois-numberis-number-objectis-observableis-promiseis-path-insideis-path-in-cwdis-plain-objis-streamis-plain-objectis-posix-bracketis-regexpis-primitiveis-svgis-regexis-utf8is-windowsisexeis-symbolis-text-pathis-stringis-whitespace-characteris-word-characterisobjectjs-yamljson-parse-better-errorsisarrayjson-loaderjsescjs-tokensjson-schema-traversejson3jsonparsejson-parse-even-better-errorsjson-stringify-safejson5lcidjsonfilekind-oflast-call-webpack-pluginlazy-cachelines-and-columnslistrlistr-silent-rendererlistr-update-rendererlocate-pathlodashlistr-verbose-rendererload-json-fileloader-runnerlodash.camelcaselodash.memoizelodash.ismatchlodash.uniqlog-symbolslog-updatejs-base64loader-utilslongloglevellru-cachelongestlower-caseloud-rejectionmake-dirloose-envifymap-visitmath-randommap-cachemarkdown-escapesmath-expression-evaluatormap-objmemmatchermd5.jsis-descriptormedia-typermemory-fsmeowmerge-descriptorsmemorystreammethodsmicromatchmimic-fnmiller-rabinminimalistic-assertmimemime-typesmime-dbmin-indentmin-documentminimalistic-crypto-utilsminimist-optionsminimatchmississippiminimistmixin-deepmove-concurrentlymkdirpmodify-valuesmulticast-dns-service-typesmsnegotiatornanomatchneo-asyncmulticast-dnsnext-tickno-casenode-dirnice-trynode-forgenormalize-package-datanode-releasesnpm-merge-drivernode-libs-browsernpm-merge-driver-installnormalize-rangenpm-run-pathnormalize-urlnormalize-pathnum2fractionnot-prereleasenpm-pathnumber-is-nannpm-whichnpm-run-allnth-checkobject-assignobject-copyobject-inspectobject-visitobject-isobject-keysobufonceobject.assignobject.omiton-finishedobject.pickon-headersos-browserifyos-localep-finallyonetimep-limitopnp-locatep-tryparallel-transformoriginalos-homediros-tmpdirp-mapparam-casepakoparse-asn1parse-entitiesparse-github-repo-urlparse-globparse-headersparse-jsonpath-dirnamepath-existspath-keyparseurlpath-is-insidepascalcasepath-browserifypath-to-regexppath-is-absolutepifypbkdf2path-typepicomatchpath-parseplease-upgrade-nodepidtreepinkiepinkie-promiseportfinderpkg-dirposix-character-classespostcsspostcss-calcpostcss-colorminpostcss-convert-valuespostcss-discard-commentspostcss-discard-duplicatespostcss-discard-emptypostcss-discard-overriddenpostcss-filter-pluginspostcss-load-configpostcss-load-optionspostcss-load-pluginspostcss-merge-identspostcss-merge-longhandpostcss-discard-unusedlint-stagedpostcss-merge-rulespostcss-message-helperspostcss-minify-font-valuespostcss-minify-paramspostcss-minify-selectorspostcss-minify-gradientspostcss-modules-extract-importspostcss-modules-local-by-defaultpostcss-normalize-charsetpostcss-modules-valuespostcss-modules-scopepostcss-normalize-urlpostcss-ordered-valuespostcss-reduce-initialpostcss-reduce-transformspostcss-reduce-identspostcss-selector-parserpostcss-svgopostcss-unique-selectorsprettierpostcss-value-parserpostcss-zindexprepend-httppretty-errorprocess-nextick-argsprivateprocesspreserveprrpseudomappumppromise-inflightpromiseproxy-addrproperty-exprpublic-encryptpumpifypunycodeqqsquerystringquery-stringquerystringifyquick-lrurandomaticrandombytesrange-parserrandomfillraw-bodyread-pkgread-pkg-upreaddirpreadable-streamredentreduce-css-calcrechoirregenerator-runtimequerystring-es3reduce-function-callregenerateregex-cacheregex-notregenerator-transformregexp.prototype.flagsregexpu-coreregjsgenrelateurlregjsparserremark-frontmatterremark-parseremove-trailing-separatorrenderkidrepeat-elementrequire-from-stringrequire-main-filenamerepeat-stringresolve-fromrepeatingreplace-extrequires-portrequire-directoryresolveresolve-urlrestore-cursorrun-noderetright-alignrimrafripemd160run-queuerust-resultrxjssafe-json-parsesafe-buffersafe-regexsemversemver-comparesafer-buffersaxschema-utilsselfsignedselect-hoseset-blockingsendserialize-javascriptserve-staticshebang-commandshebang-regexset-valuesetimmediatesetprototypeofsha.jssignal-exitslashshell-quoteshelljsshxserve-indexslice-ansisnapdragon-utilsockjssimple-gitsockjs-clientsort-keyssource-mapsource-list-mapspdx-exceptionssource-map-resolvesource-map-supportsource-map-urlspdx-correctspdx-expression-parsespdx-license-idsspdysplitspdy-transportsplit-stringsplit2ssrisprintf-jsstaged-git-filesstate-togglestatic-extendstatusesstrict-uri-encodestream-browserifystream-eachstream-shiftstream-httpstring-argvstring-widthstring.prototype.padendstring.prototype.trimendstring.prototype.trimstartstrip-bomstrip-eofstring_decoderstringify-objectstrip-ansisupports-colorstrip-indenttapablestructured-sourcesvgosymbol-observabletext-extensionstemp-dirsynchronous-promisetempfilethrough2throughthunkytime-stamptimers-browserifytoposortto-fast-propertiesto-arraybufferto-object-pathto-regextrimto-regex-rangetoidentifiertraversetrim-newlinestrim-off-newlinestrim-righttsmltrim-trailing-linestroughtslibtty-browserifyuglify-estypetype-festtypedarrayunderscoreuglify-to-browserifyunbox-primitiveunherittype-isunifiedunion-valueuniquniqsunist-util-isunique-slugunique-filenameunist-util-stringify-positionunist-util-remove-positionunist-util-visit-parentsunist-util-visituniversalifyunpipeunset-valueurixurlupathupper-caseupdate-sectionuri-jsurl-parseurl-toolkituseutilautilutil-deprecateutils-mergeuuidvalidate-npm-package-licensevendorsvaryvfilevfile-locationvfile-messagevideo.jsvideojs-fontvideojs-ie8vue-style-loadervideojs-swfvideojs-vtt.jsvm-browserifywatchpack-chokidar2wbufvue-hot-reload-apivue-template-es2015-compilerwasm-dcewebassembly-floating-point-hex-parserwatchpackwebpack-dev-middlewarewebassembly-interpreterwebpack-sourceswhichwebsocket-extensionswebworkifywhet.extendwhich-boxed-primitivewhich-modulewindow-sizewordwrapworker-farmwebsocket-driverwrap-ansiwrappyx-is-stringxhry18nyallistsnapdragonsnapdragon-nodextendyargsyargs-parseryup
3.3.9

3 years ago