当前位置:   article > 正文

vue播放直播rtmp_dplayer播放rtsp

dplayer播放rtsp
  1. <template>
  2. <div id="app">
  3. <!-- <github-badge slug="slacrey/vue-aliplayer" /> -->
  4. <ali-player @play="played" :autoplay="true" :source="aplayer.source"
  5. :vid="aplayer.vid" ref="player"></ali-player>
  6. <div style="margin-top:20px;">
  7. <button @click="play">播放</button>
  8. <button @click="pause">暂停</button>
  9. <button @click="replay">重播</button>
  10. <button @click="convert">切换</button>
  11. </div>
  12. </div>
  13. </template>
  14. <script>
  15. import VueAliplayer from "../src/VueAliplayer.vue";
  16. // import GitHubBadge from "vue-github-badge";
  17. export default {
  18. data() {
  19. return {
  20. aplayer: {
  21. source:"rtmp://58.200.131.2:1935/livetv/ahtv",
  22. vid: "bf9b7e4a36d84aea8cee769765fbc28b",
  23. videoHeight:"1000px",
  24. videoWidth:"800px"
  25. },
  26. player: null
  27. };
  28. },
  29. methods: {
  30. played() {
  31. console.log("play callback");
  32. },
  33. play() {
  34. const player = this.$refs.player.instance;
  35. player && player.play();
  36. },
  37. pause() {
  38. const player = this.$refs.player.instance;
  39. player && player.pause();
  40. },
  41. replay() {
  42. const player = this.$refs.player.instance;
  43. player && player.replay();
  44. },
  45. convert() {
  46. this.aplayer.source = 'rtmp://58.200.131.2:1935/livetv/ahtv';
  47. const player = this.$refs.player;
  48. player && player.reloadPlayer();
  49. }
  50. },
  51. components: {
  52. "ali-player": VueAliplayer,
  53. // "github-badge": GitHubBadge
  54. }
  55. };
  56. </script>
  57. <style>
  58. body {
  59. margin: 0;
  60. padding: 0;
  61. text-align: center;
  62. }
  63. a {
  64. color: #42b983;
  65. text-decoration: none;
  66. }
  67. .dplayer {
  68. width: 800px;
  69. margin: 50px auto;
  70. }
  71. h1 {
  72. font-size: 54px;
  73. color: #42b983;
  74. margin: 30px 0 10px;
  75. }
  76. h2 {
  77. font-size: 22px;
  78. color: #555;
  79. }
  80. @media (max-width: 768px) {
  81. .dplayer {
  82. width: 90%;
  83. }
  84. h1 {
  85. font-size: 30px;
  86. }
  87. h2 {
  88. font-size: 16px;
  89. }
  90. }
  91. </style>

 

 

 

  1. <template>
  2. <div class="prism-player" :id="playerId" :style="playStyle"></div>
  3. </template>
  4. <script>
  5. export default {
  6. name: "Aliplayer",
  7. props: {
  8. source: {
  9. type: String,
  10. default: ""
  11. },
  12. //媒体转码服务的媒体Id。
  13. vid: {
  14. type: String,
  15. default: ""
  16. },
  17. //播放权证
  18. playauth: {
  19. type: String,
  20. default: ""
  21. },
  22. //容器的大小
  23. height: {
  24. type: String,
  25. default: "320px"
  26. },
  27. //容器的大小
  28. width: {
  29. type: String,
  30. default: "100%"
  31. },
  32. //视频的高度大小
  33. videoWidth: {
  34. type: String,
  35. default: "100%"
  36. },
  37. //视频的宽度大小
  38. videoHeight: {
  39. type: String,
  40. default: "320px"
  41. },
  42. //播放器自动加载,目前仅h5可用
  43. preload: {
  44. type: Boolean,
  45. default: false
  46. },
  47. //播放器默认封面图片,请填写正确的图片url地址。需要autoplay为’false’时,才生效
  48. cover: {
  49. type: String,
  50. default: ""
  51. },
  52. //播放内容是否为直播,直播时会禁止用户拖动进度条。
  53. isLive: {
  54. type: Boolean,
  55. default: false
  56. },
  57. //播放器是否自动播放,在移动端autoplay属性会失效。
  58. autoplay: {
  59. type: Boolean,
  60. default: false
  61. },
  62. //播放器自动循环播放。
  63. rePlay: {
  64. type: Boolean,
  65. default: false
  66. },
  67. //指定使用H5播放器。
  68. useH5Prism: {
  69. type: Boolean,
  70. default: false
  71. },
  72. //指定使用Flash播放器。
  73. useFlashPrism: {
  74. type: Boolean,
  75. default: false
  76. },
  77. //H5是否内置播放,有的Android浏览器不起作用。
  78. playsinline: {
  79. type: Boolean,
  80. default: false
  81. },
  82. //显示播放时缓冲图标,默认true
  83. showBuffer: {
  84. type: Boolean,
  85. default: true
  86. },
  87. //URL 皮肤图片,不建议随意修改该字段,如要修改,请参照皮肤定制。
  88. skinRes: {
  89. type: String,
  90. default: ""
  91. },
  92. skinLayout: {
  93. type: Array,
  94. default: function () {
  95. return []
  96. }
  97. },
  98. //默认为‘hover’。可选的值为:‘click’、‘hover’、‘always’。
  99. controlBarVisibility: {
  100. type: String,
  101. default: "hover"
  102. },
  103. //控制栏自动隐藏时间(ms)
  104. showBarTime: {
  105. type: String,
  106. default: ""
  107. },
  108. /***
  109. * JSON串用于定制性接口参数,目前支持:
  110. 1.“fullTitle”:“测试页面”
  111. 全屏时显示视频标题(仅flash支持)。
  112. 2. “m3u8BufferLength”:“30
  113. 播放m3u8时加载缓存ts文件长度单位(秒)(仅flash支持)。
  114. 3. “liveStartTime”:“2016/08/17 12:00:00
  115. 直播开始时间,用于提示直播未开始(仅flash支持)。
  116. 4. “liveOverTime”:“2016/08/17 14:00:00
  117. 直播结束时间,用于提示直播结束(仅flash支持)。
  118. */
  119. extraInfo: {
  120. type: String,
  121. default: ""
  122. },
  123. /**
  124. *是否允许系统右键菜单显示,默认为false
  125. */
  126. enableSystemMenu: {
  127. type: Boolean,
  128. default: false
  129. },
  130. /***
  131. *
  132. *指定播放地址格式,只有使用vid的播放方式时支持
  133. 可选值为’mp4’、’m3u8’、’flv’、’mp3’,默认为空,仅H5支持。
  134. * */
  135. format: {
  136. type: String,
  137. default: "mp4"
  138. },
  139. /***
  140. *
  141. * 指定返回音频还是视频,只有使用vid的播放方式时支持。
  142. 可选值为’video’和’audio’,默认为’video’
  143. ‘audio’主要是针对只包含音频的视频格式,比如音频的mp4,仅H5支持。
  144. * */
  145. mediaType: {
  146. type: String,
  147. default: "video"
  148. },
  149. /***
  150. * 指定排序方式,只有使用vid + plauth播放方式时支持。
  151. ‘desc’表示按倒序排序(即:从大到小排序)
  152. ‘asc’表示按正序排序(即:从小到大排序)
  153. 默认值:‘asc’,仅H5支持。
  154. * */
  155. qualitySort: {
  156. type: String,
  157. default: "asc"
  158. },
  159. /***
  160. * 显示视频清晰度,多个用逗号分隔,比如:’FD,LD’,此值是vid对应流清晰度的一个子集,
  161. 取值范围:FD(流畅)LD(标清)SD(高清)HD(超清)OD(原画)2K(2K)4K(4K),仅H5支持。
  162. * */
  163. definition: {
  164. type: String,
  165. default: ""
  166. },
  167. /**
  168. * 默认视频清晰度,此值是vid对应流的一个清晰度,
  169. 取值范围:FD(流畅)LD(标清)SD(高清)HD(超清)OD(原画)2K(2K)4K(4K),仅H5支持。
  170. * */
  171. defaultDefinition: {
  172. type: String,
  173. default: ""
  174. },
  175. /**
  176. * 声明启用同层H5播放器,启用时设置的值为‘h5
  177. * */
  178. x5_type: {
  179. type: String,
  180. default: "h5"
  181. },
  182. /**
  183. * 声明视频播放时是否进入到TBS的全屏模式,默认为false
  184. 当需要把视频做为背景时,设置为true
  185. * */
  186. x5_fullscreen: {
  187. type: Boolean,
  188. default: false
  189. },
  190. /**
  191. * 声明视频播在界面上的位置,默认为“center”。
  192. 可选值为:“top”,“center”
  193. * */
  194. x5_video_position: {
  195. type: String,
  196. default: "center"
  197. },
  198. /**
  199. * 声明 TBS 播放器支持的方向,可选值:
  200. landscape:横屏)
  201. portraint:竖屏
  202. landscape
  203. * */
  204. x5_orientation: {
  205. type: String,
  206. default: "portraint"
  207. },
  208. /**
  209. * 声明TBS全屏播放是否横屏,默认值为true
  210. * */
  211. x5LandscapeAsFullScreen: {
  212. type: String,
  213. default: "true"
  214. },
  215. /**
  216. * 延迟播放时间,单位为秒。
  217. * */
  218. autoPlayDelay: {
  219. type: Number,
  220. default: 0
  221. },
  222. /**
  223. * 延迟播放提示文本
  224. * */
  225. autoPlayDelayDisplayText: {
  226. type: String,
  227. default: "正在转码,请稍后......"
  228. },
  229. /**
  230. * 国际化,默认为‘zh-cn’。
  231. 如果未设置,则采用浏览器语言。
  232. 可选值为‘zh-cn’、‘en-us’或其它值。
  233. * */
  234. language: {
  235. type: String,
  236. default: "zh-cn"
  237. },
  238. /**
  239. * 自定义国际化文本json结构,key的值需要和language属性值对应起来。
  240. 例子:{jp:{Play:”Play”}}
  241. * */
  242. languageTexts: {
  243. type: Object,
  244. default: function () {
  245. return {}
  246. }
  247. },
  248. /**
  249. * flash启用截图功能
  250. * */
  251. snapshot: {
  252. type: Boolean,
  253. default: false
  254. },
  255. /**
  256. * H5设置截图水印。
  257. * */
  258. snapshotWatermark: {
  259. type: Object,
  260. default: function () {
  261. return {}
  262. }
  263. },
  264. /**
  265. * Safari浏览器可以启用Hls插件播放,Safari 11除外。
  266. * */
  267. useHlsPluginForSafari: {
  268. type: Boolean,
  269. default: false
  270. },
  271. /**
  272. * H5播放flv时,设置是否启用播放缓存,只在直播下起作用。
  273. * */
  274. enableStashBufferForFlv: {
  275. type: Boolean,
  276. default: false
  277. },
  278. /**
  279. * H5播放flv时,初始缓存大小,只在直播下起作用。
  280. * */
  281. stashInitialSizeForFlv: {
  282. type: Number,
  283. default: 10
  284. },
  285. /**
  286. * 缓冲多长时间后,提示用户切换低清晰度,默认:20秒。
  287. * */
  288. loadDataTimeout: {
  289. type: Number,
  290. default: 20
  291. },
  292. /**
  293. *最大缓冲超时时间,超过这个时间会有错误提示,默认:60秒。
  294. * */
  295. waitingTimeout: {
  296. type: Number,
  297. default: 60
  298. },
  299. /**
  300. * 直播开始时间,直播时移功能使用,格式为:“2018/01/04 12:00:00”。
  301. * */
  302. liveStartTime: {
  303. type: String,
  304. default: ""
  305. },
  306. /**
  307. * 直播结束时间,直播时移功能使用,格式为:“2018/01/04 12:00:00”。
  308. * */
  309. liveOverTime: {
  310. type: String,
  311. default: ""
  312. },
  313. /**
  314. * 直播可用时移查询地址,详情参见直播时移。
  315. * https://help.aliyun.com/document_detail/65129.html?spm=a2c4g.11186623.2.28.3603bf80LR74sS
  316. * */
  317. liveTimeShiftUrl: {
  318. type: String,
  319. default: ""
  320. },
  321. /**
  322. * flv直播和hls时移切换是,重新创建播放器方法,详情参见直播时移。
  323. * https://help.aliyun.com/document_detail/65129.html?spm=a2c4g.11186623.2.28.3603bf80LR74sS
  324. * */
  325. recreatePlayer: {
  326. type: Function,
  327. default: function () {
  328. }
  329. },
  330. /**
  331. *是否显示检测按钮,默认为true
  332. * */
  333. diagnosisButtonVisible: {
  334. type: Boolean,
  335. default: true
  336. },
  337. /**
  338. * 禁用进度条的Seek,默认为false,仅Flash支持。
  339. * */
  340. disableSeek: {
  341. type: Boolean,
  342. default: false
  343. },
  344. /**
  345. * 加密类型,播放点播私有加密视频时,设置值为1,默认值为0
  346. * */
  347. encryptType: {
  348. type: Number,
  349. default: 0
  350. },
  351. /**
  352. * 进度条打点内容数组,详情参见进度条打点。
  353. * [
  354. {offset:0,text:'阿里视频云端到云到端服务的重要一环'},
  355. {offset:10,text:'除了支持点播和直播的基础播放功能外'},
  356. {offset:20,text:'深度融合视频云业务'},
  357. {offset:30,text:'为用户提供简单、快速、安全、稳定的视频播放服务'},
  358. {offset:40,text:'安装播放器Demo进行体验'},
  359. {offset:50,text:'开发人员请点击SDK下载'}
  360. ]
  361. * https://yq.aliyun.com/articles/686043?spm=a2c4g.11186623.2.31.3603bf80LR74sS
  362. * */
  363. progressMarkers: {
  364. type: Array,
  365. default: function () {
  366. return []
  367. }
  368. },
  369. /**
  370. * 点播失败重试次数,默认3
  371. * */
  372. vodRetry: {
  373. type: Number,
  374. default: 3
  375. },
  376. /**
  377. * 直播播放失败重试次数,默认5
  378. * */
  379. liveRetry: {
  380. type: Number,
  381. default: 5
  382. },
  383. playStyle: {
  384. type: String,
  385. default: ""
  386. },
  387. aliplayerSdkPath: {
  388. // Aliplayer 代码的路径
  389. type: String,
  390. default: "//g.alicdn.com/de/prismplayer/2.8.2/aliplayer-min.js"
  391. },
  392. },
  393. data() {
  394. return {
  395. playerId: "aliplayer_" + Math.random().toString(36).substr(2),
  396. scriptTagStatus: 0,
  397. isReload: false,
  398. instance: null
  399. };
  400. },
  401. created() {
  402. if (window.Aliplayer !== undefined) {
  403. // 如果全局对象存在,说明编辑器代码已经初始化完成,直接加载编辑器
  404. this.scriptTagStatus = 2;
  405. this.initAliplayer();
  406. } else {
  407. // 如果全局对象不存在,说明编辑器代码还没有加载完成,需要加载编辑器代码
  408. this.insertScriptTag();
  409. }
  410. },
  411. mounted() {
  412. if (window.Aliplayer !== undefined) {
  413. // 如果全局对象存在,说明编辑器代码已经初始化完成,直接加载编辑器
  414. this.scriptTagStatus = 2;
  415. this.initAliplayer();
  416. } else {
  417. // 如果全局对象不存在,说明编辑器代码还没有加载完成,需要加载编辑器代码
  418. this.insertScriptTag();
  419. }
  420. },
  421. methods: {
  422. insertScriptTag() {
  423. const _this = this;
  424. let playerScriptTag = document.getElementById("playerScriptTag");
  425. // 如果这个tag不存在,则生成相关代码tag以加载代码
  426. if (playerScriptTag === null) {
  427. playerScriptTag = document.createElement("script");
  428. playerScriptTag.type = "text/javascript";
  429. playerScriptTag.src = this.aliplayerSdkPath;
  430. playerScriptTag.id = "playerScriptTag";
  431. let s = document.getElementsByTagName("head")[0];
  432. s.appendChild(playerScriptTag);
  433. }
  434. if (playerScriptTag.loaded) {
  435. _this.scriptTagStatus++;
  436. } else {
  437. playerScriptTag.addEventListener("load", () => {
  438. _this.scriptTagStatus++;
  439. playerScriptTag.loaded = true;
  440. _this.initAliplayer();
  441. });
  442. }
  443. _this.initAliplayer();
  444. },
  445. initAliplayer() {
  446. const _this = this;
  447. // scriptTagStatus 为 2 的时候,说明两个必需引入的 js 文件都已经被引入,且加载完成
  448. if (
  449. _this.scriptTagStatus === 2 &&
  450. (_this.instance === null || _this.reloadPlayer)
  451. ) {
  452. _this.instance && _this.instance.dispose();
  453. document.querySelector("#" + _this.playerId).innerHTML = "";
  454. // Vue 异步执行 DOM 更新,这样一来代码执行到这里的时候可能 template 里面的 script 标签还没真正创建
  455. // 所以,我们只能在 nextTick 里面初始化 Aliplayer
  456. _this.$nextTick(() => {
  457. _this.instance = window.Aliplayer({
  458. id: _this.playerId,
  459. source: _this.source,
  460. vid: _this.vid,
  461. playauth: _this.playauth,
  462. width: _this.width,
  463. height: _this.height,
  464. videoWidth: _this.videoWidth,
  465. videoHeight: _this.videoHeight,
  466. preload: _this.preload,
  467. cover: _this.cover,
  468. isLive: _this.isLive,
  469. autoplay: _this.autoplay,
  470. rePlay: _this.rePlay,
  471. useH5Prism: _this.useH5Prism,
  472. useFlashPrism: _this.useFlashPrism,
  473. playsinline: _this.playsinline,
  474. showBuffer: _this.showBuffer,
  475. skinRes: _this.skinRes,
  476. skinLayout: _this.skinLayout,
  477. controlBarVisibility: _this.controlBarVisibility,
  478. showBarTime: _this.showBarTime,
  479. extraInfo: _this.extraInfo,
  480. enableSystemMenu: _this.enableSystemMenu,
  481. format: _this.format,
  482. mediaType: _this.mediaType,
  483. qualitySort: _this.qualitySort,
  484. definition: _this.definition,
  485. defaultDefinition: _this.defaultDefinition,
  486. x5_type: _this.x5_type,
  487. x5_fullscreen: _this.x5_fullscreen,
  488. x5_video_position: _this.x5_video_position,
  489. x5_orientation: _this.x5_orientation,
  490. x5LandscapeAsFullScreen: _this.x5LandscapeAsFullScreen,
  491. autoPlayDelay: _this.autoPlayDelay,
  492. autoPlayDelayDisplayText: _this.autoPlayDelayDisplayText,
  493. language: _this.language,
  494. languageTexts: _this.languageTexts,
  495. snapshot: _this.snapshot,
  496. snapshotWatermark: _this.snapshotWatermark,
  497. useHlsPluginForSafari: _this.useHlsPluginForSafari,
  498. enableStashBufferForFlv: _this.enableStashBufferForFlv,
  499. stashInitialSizeForFlv: _this.stashInitialSizeForFlv,
  500. loadDataTimeout: _this.loadDataTimeout,
  501. waitingTimeout: _this.waitingTimeout,
  502. liveStartTime: _this.liveStartTime,
  503. liveTimeShiftUrl: _this.liveTimeShiftUrl,
  504. liveShiftSource: _this.liveShiftSource,
  505. recreatePlayer: _this.recreatePlayer,
  506. diagnosisButtonVisible: _this.diagnosisButtonVisible,
  507. disableSeek: _this.disableSeek,
  508. encryptType: _this.encryptType,
  509. progressMarkers: _this.progressMarkers,
  510. vodRetry: _this.vodRetry,
  511. liveRetry: _this.liveRetry,
  512. });
  513. // 绑定事件,当 AliPlayer 初始化完成后,将编辑器实例通过自定义的 ready 事件交出去
  514. _this.instance.on("ready", () => {
  515. this.$emit("ready", _this.instance);
  516. });
  517. _this.instance.on("play", () => {
  518. this.$emit("play", _this.instance);
  519. });
  520. _this.instance.on("pause", () => {
  521. this.$emit("pause", _this.instance);
  522. });
  523. _this.instance.on("ended", () => {
  524. this.$emit("ended", _this.instance);
  525. });
  526. _this.instance.on("liveStreamStop", () => {
  527. this.$emit("liveStreamStop", _this.instance);
  528. });
  529. _this.instance.on("m3u8Retry", () => {
  530. this.$emit("m3u8Retry", _this.instance);
  531. });
  532. _this.instance.on("hideBar", () => {
  533. this.$emit("hideBar", _this.instance);
  534. });
  535. _this.instance.on("waiting", () => {
  536. this.$emit("waiting", _this.instance);
  537. });
  538. _this.instance.on("snapshoted", () => {
  539. this.$emit("snapshoted", _this.instance);
  540. });
  541. _this.instance.on("timeupdate", () => {
  542. this.$emit("timeupdate", _this.instance);
  543. });
  544. _this.instance.on("requestFullScreen", () => {
  545. this.$emit("requestFullScreen", _this.instance);
  546. });
  547. _this.instance.on("cancelFullScreen", () => {
  548. this.$emit("cancelFullScreen", _this.instance);
  549. });
  550. _this.instance.on("error", () => {
  551. this.$emit("error", _this.instance);
  552. });
  553. _this.instance.on("startSeek", () => {
  554. this.$emit("startSeek", _this.instance);
  555. });
  556. _this.instance.on("completeSeek", () => {
  557. this.$emit("completeSeek", _this.instance);
  558. });
  559. });
  560. }
  561. },
  562. /**
  563. * 播放视频
  564. */
  565. play: function () {
  566. this.instance.play();
  567. },
  568. /**
  569. * 暂停视频
  570. */
  571. pause: function () {
  572. this.instance.pause();
  573. },
  574. /**
  575. * 重播视频
  576. */
  577. replay: function () {
  578. this.instance.replay();
  579. },
  580. /**
  581. * 跳转到某个时刻进行播放
  582. * @argument time 的单位为秒
  583. */
  584. seek: function (time) {
  585. this.instance.seek(time);
  586. },
  587. /**
  588. * 获取当前时间 单位秒
  589. */
  590. getCurrentTime: function () {
  591. return this.instance.getCurrentTime();
  592. },
  593. /**
  594. *获取视频总时长,返回的单位为秒
  595. * @returns 返回的单位为秒
  596. */
  597. getDuration: function () {
  598. return this.instance.getDuration();
  599. },
  600. /**
  601. 获取当前的音量,返回值为0-1的实数ios和部分android会失效
  602. */
  603. getVolume: function () {
  604. return this.instance.getVolume();
  605. },
  606. /**
  607. 设置音量,vol为0-1的实数,ios和部分android会失效
  608. */
  609. setVolume: function (vol) {
  610. this.instance.setVolume(vol);
  611. },
  612. /**
  613. *直接播放视频url,time为可选值(单位秒)目前只支持同种格式(mp4/flv/m3u8)之间切换暂不支持直播rtmp流切换
  614. *@argument url 视频地址
  615. *@argument time 跳转到多少秒
  616. */
  617. loadByUrl: function (url, time) {
  618. this.instance.loadByUrl(url, time);
  619. },
  620. /**
  621. * 设置播放速度
  622. *@argument speed 速度
  623. */
  624. setSpeed: function (speed) {
  625. this.instance.setSpeed(speed);
  626. },
  627. /**
  628. * 设置播放器大小w,h可分别为400px像素或60%百分比chrome浏览器下flash播放器分别不能小于397x297
  629. *@argument w 播放器宽度
  630. *@argument h 播放器高度
  631. */
  632. setPlayerSize: function (w, h) {
  633. this.instance.setPlayerSize(w, h);
  634. },
  635. /**
  636. *目前只支持H5播放器。
  637. 暂不支持不同格式视频间的之间切换。
  638. 暂不支持直播rtmp流切换。
  639. */
  640. replayByVidAndPlayAuth: function (vid, accId, accSecret, stsToken, authInfo, domainRegion) {
  641. this.instance.replayByVidAndPlayAuth(vid, accId, accSecret, stsToken, authInfo, domainRegion);
  642. },
  643. /***
  644. * 重新设置vid和权限,目前只支持H5播放器。
  645. 暂不支持不同格式视频间的之间切换。
  646. 暂不支持直播rtmp流切换。
  647. * @param vid 视频ID
  648. * @param playauth 播放权限
  649. */
  650. replayByVidAndAuthInfo: function (vid, playauth) {
  651. this.instance.replayByVidAndAuthInfo(vid, playauth);
  652. },
  653. /**
  654. * 目前只支持HTML5界面上的重载功能,暂不支持直播rtmp流切换m3u8)之间切换,暂不支持直播rtmp流切换
  655. *@argument vid 视频id
  656. *@argument playauth 播放凭证
  657. */
  658. reloaduserPlayInfoAndVidRequestMts: function (vid, playauth) {
  659. this.instance.reloaduserPlayInfoAndVidRequestMts(vid, playauth);
  660. },
  661. /***
  662. *设置截图参数
  663. * @param width 宽度
  664. * @param height 高度
  665. * @param rate 截图质量
  666. */
  667. setSanpshotProperties: function (width, height, rate) {
  668. this.instance.setSanpshotProperties(width, height, rate);
  669. },
  670. /**
  671. * 设置封面地址
  672. * @param cover 封面地址
  673. */
  674. setCover: function (cover) {
  675. this.instance.setCover(cover);
  676. },
  677. reloadPlayer: function () {
  678. this.isReload = true;
  679. this.initAliplayer();
  680. this.isReload = false;
  681. }
  682. }
  683. };
  684. </script>
  685. <style>
  686. @import url(//g.alicdn.com/de/prismplayer/2.8.2/skins/default/aliplayer-min.css);
  687. </style>

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/IT小白/article/detail/866761
推荐阅读
相关标签