From 7da4f1051ebc06d08f31824b031c2a850c1cdb24 Mon Sep 17 00:00:00 2001 From: HCLonely Date: Fri, 17 Feb 2023 18:44:58 +0800 Subject: [PATCH] Update at 2023-02-17 18:44:58 --- .gitignore | 2 ++ dist/artplayer-plugin-playlist.browser.js | 8 +++++--- dist/artplayer-plugin-playlist.js | 8 +++++--- dist/artplayer-plugin-playlist.min.js | 2 +- package.json | 2 +- src/artplayer-plugin-playlist.js | 8 +++++--- 6 files changed, 19 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index b8b9ae6..1561969 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ node_modules/ .history/ + +test.js diff --git a/dist/artplayer-plugin-playlist.browser.js b/dist/artplayer-plugin-playlist.browser.js index 1f0dcea..3f15cb5 100644 --- a/dist/artplayer-plugin-playlist.browser.js +++ b/dist/artplayer-plugin-playlist.browser.js @@ -29,6 +29,7 @@ var artplayerPlaylist = function artplayerPlaylist(options) { if (!options.playlist[index]) { return; } + // 获取artplayer配置 var artOptions = art.option; var newArtplayer = art; @@ -40,7 +41,8 @@ var artplayerPlaylist = function artplayerPlaylist(options) { // 重建artplayer newArtplayer = new Artplayer(_objectSpread(_objectSpread(_objectSpread({}, artOptions), options.playlist[index]), {}, { autoplay: (_options$autoNext = options.autoNext) !== null && _options$autoNext !== void 0 ? _options$autoNext : artOptions.autoplay, - i18n: addedI18n + i18n: addedI18n, + id: "".concat(artOptions.id, "-").concat(index === 0 ? '' : index) })); } else { art.switchUrl(options.playlist[index].url, options.playlist[index].title); @@ -55,7 +57,7 @@ var artplayerPlaylist = function artplayerPlaylist(options) { } }; - // 自动播放下一集 + // 自动播放下一P var currentEp = options.playlist.findIndex(function (videoInfo) { return videoInfo.url === art.option.url; }); @@ -66,7 +68,7 @@ var artplayerPlaylist = function artplayerPlaylist(options) { } var icon = ''; - // 添加播放列表 + // 添加播放列表控件 art.controls.add({ name: 'playlist', position: 'right', diff --git a/dist/artplayer-plugin-playlist.js b/dist/artplayer-plugin-playlist.js index ecb54d9..ebc4ad7 100644 --- a/dist/artplayer-plugin-playlist.js +++ b/dist/artplayer-plugin-playlist.js @@ -28,6 +28,7 @@ var artplayerPlaylist = function artplayerPlaylist(options) { if (!options.playlist[index]) { return; } + // 获取artplayer配置 var artOptions = art.option; var newArtplayer = art; @@ -39,7 +40,8 @@ var artplayerPlaylist = function artplayerPlaylist(options) { // 重建artplayer newArtplayer = new Artplayer(_objectSpread(_objectSpread(_objectSpread({}, artOptions), options.playlist[index]), {}, { autoplay: (_options$autoNext = options.autoNext) !== null && _options$autoNext !== void 0 ? _options$autoNext : artOptions.autoplay, - i18n: addedI18n + i18n: addedI18n, + id: "".concat(artOptions.id, "-").concat(index === 0 ? '' : index) })); } else { art.switchUrl(options.playlist[index].url, options.playlist[index].title); @@ -54,7 +56,7 @@ var artplayerPlaylist = function artplayerPlaylist(options) { } }; - // 自动播放下一集 + // 自动播放下一P var currentEp = options.playlist.findIndex(function (videoInfo) { return videoInfo.url === art.option.url; }); @@ -65,7 +67,7 @@ var artplayerPlaylist = function artplayerPlaylist(options) { } var icon = ''; - // 添加播放列表 + // 添加播放列表控件 art.controls.add({ name: 'playlist', position: 'right', diff --git a/dist/artplayer-plugin-playlist.min.js b/dist/artplayer-plugin-playlist.min.js index 32890b9..222434f 100644 --- a/dist/artplayer-plugin-playlist.min.js +++ b/dist/artplayer-plugin-playlist.min.js @@ -1 +1 @@ -!function t(e,r,n){function o(l,a){if(!r[l]){if(!e[l]){var u="function"==typeof require&&require;if(!a&&u)return u(l,!0);if(i)return i(l,!0);var c=new Error("Cannot find module '"+l+"'");throw c.code="MODULE_NOT_FOUND",c}var f=r[l]={exports:{}};e[l][0].call(f.exports,(function(t){return o(e[l][1][t]||t)}),f,f.exports,t,e,r,n)}return r[l].exports}for(var i="function"==typeof require&&require,l=0;l (art) => { if (!options.playlist[index]) { return; } + // 获取artplayer配置 const artOptions = art.option; @@ -28,7 +29,8 @@ const artplayerPlaylist = (options) => (art) => { ...artOptions, ...options.playlist[index], autoplay: options.autoNext ?? artOptions.autoplay, - i18n: addedI18n + i18n: addedI18n, + id: `${artOptions.id}-${index === 0 ? '' : index}` }); } else { art.switchUrl(options.playlist[index].url, options.playlist[index].title); @@ -43,7 +45,7 @@ const artplayerPlaylist = (options) => (art) => { } }; - // 自动播放下一集 + // 自动播放下一P const currentEp = options.playlist.findIndex((videoInfo) => videoInfo.url === art.option.url); if (options.autoNext && currentEp < options.playlist.length) { art.on('video:ended', () => { @@ -53,7 +55,7 @@ const artplayerPlaylist = (options) => (art) => { const icon = ''; - // 添加播放列表 + // 添加播放列表控件 art.controls.add({ name: 'playlist', position: 'right',