Skip to content

Commit

Permalink
fix(common): ensure all control bar icons are hidden when isLive is e…
Browse files Browse the repository at this point in the history
…nabled (#149)

* fix(common): ensure all control bar icons are hidden when isLive is enabled
* feat(common): add new key word for localization

---------

Co-authored-by: CY <shiyiya.11@gmail.com>
  • Loading branch information
code-lish and shiyiya authored Jan 8, 2025
1 parent 1239fdb commit 62cbd7f
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@oplayer/core",
"version": "1.2.38-beta.1",
"version": "1.2.38-beta.2",
"description": "Oh! Another HTML5 video player.",
"type": "module",
"main": "./dist/index.es.js",
Expand Down
4 changes: 3 additions & 1 deletion packages/core/src/i18n/fa.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
"LIVE": "زنده",
"WebFullscreen": "تمام صفحه وب",
"Chromecast": "کروم کاست",
"AirPlay": "ایر پلی",
"AirPlay":"ایر پلی",
"Playlist":"پلی‌لیست",
"Heatmap":"نقشهٔ حرارتی",

"Language": "زبان",
"Screenshot": "عکس صفحه",
Expand Down
4 changes: 3 additions & 1 deletion packages/core/src/i18n/pa.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
"LIVE": "ژوندی",
"WebFullscreen": "د تمام صفحه وب",
"Chromecast": "کروم کاسټ",
"AirPlay": "ایر پلی",
"AirPlay":"ایر پلی",
"Playlist":"پلې‌لسټ",
"Heatmap":"د ډېرو کتلو نقشه",

"Language": "ژبه",
"Screenshot": "سکرین شاټ",
Expand Down
1 change: 1 addition & 0 deletions packages/danmaku/src/heatmap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export default class Heatmap {
public heatmap: boolean,
public customHeatmap?: Options['customHeatmap']
) {
if(!player.context.ui.$progress) return
const $progress = player.context.ui.$progress.firstElementChild
const $root = document.createElement('div')
this.$root = $root
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@oplayer/plugins",
"version": "1.0.15-beta.0",
"version": "1.0.15-beta.1",
"author": "shiyiya",
"description": "oplayer's plugin",
"homepage": "https://github.com/shiyiya/oplayer",
Expand Down
7 changes: 4 additions & 3 deletions packages/plugins/src/playlist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ export default class PlaylistPlugin implements PlayerPlugin {
renderContainer() {
const $playlist = `
<div class="playlist-head">
<span class="playlist-head-title">${this.player.locales.get('PLAYLIST')}</span>
<span class="playlist-head-title">${this.player.locales.get('Playlist')}</span>
<div class="playlist-back">${
this.player.context.ui.icons.playlist ||
`<svg viewBox="0 0 32 32"><path d="m 12.59,20.34 4.58,-4.59 -4.58,-4.59 1.41,-1.41 6,6 -6,6 z"></path></svg>`
Expand Down Expand Up @@ -238,7 +238,8 @@ export default class PlaylistPlugin implements PlayerPlugin {
this.player.context.ui.$root.appendChild(this.$root)

this.player.context.ui.menu.register({
name: 'Playlist',
name: this.player.locales.get('Playlist'),

icon: `<svg style="transform: scale(1.2);" viewBox="0 0 1024 1024"><path d="M213.333333 426.666667h426.666667c23.466667 0 42.666667 19.2 42.666667 42.666666s-19.2 42.666667-42.666667 42.666667H213.333333c-23.466667 0-42.666667-19.2-42.666666-42.666667s19.2-42.666667 42.666666-42.666666z m0-170.666667h426.666667c23.466667 0 42.666667 19.2 42.666667 42.666667s-19.2 42.666667-42.666667 42.666666H213.333333c-23.466667 0-42.666667-19.2-42.666666-42.666666s19.2-42.666667 42.666666-42.666667z m0 341.333333h256c23.466667 0 42.666667 19.2 42.666667 42.666667s-19.2 42.666667-42.666667 42.666667H213.333333c-23.466667 0-42.666667-19.2-42.666666-42.666667s19.2-42.666667 42.666666-42.666667z m384 37.546667v180.48c0 16.64 17.92 26.88 32.426667 18.346667l150.613333-90.453334c13.653333-8.106667 13.653333-28.16 0-36.693333l-150.613333-90.453333a21.674667 21.674667 0 0 0-32.426667 18.773333z"></path></svg>`,
position: 'top',
onClick: () => {
Expand Down Expand Up @@ -281,7 +282,7 @@ export default class PlaylistPlugin implements PlayerPlugin {

_updateHeader() {
this.$root.querySelector('.playlist-head-title')!.textContent = `${this.player.locales.get(
'PLAYLIST'
'Playlist'
)} (${this.currentIndex !== undefined ? `${this.currentIndex + 1}/` : ''}${this.options.sources.length})`
}

Expand Down
2 changes: 1 addition & 1 deletion packages/ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@oplayer/ui",
"version": "1.3.4-beta.1",
"version": "1.3.4-beta.2",
"description": "ui plugin for oplayer",
"type": "module",
"main": "./dist/index.es.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/ControllerBottom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const render = (it: UIInterface, $el: HTMLDivElement) => {

const el = $.render($.create(`div.${controllerBottomWrap}`), $el)

if (!config.theme.progress?.mini) {
if (!config.theme.progress?.mini || player.options.isLive) {
$.css({
[`@global .${controllerHidden} .${controllerBottomWrap}`]: {
transform: 'translateY(100%)'
Expand Down

0 comments on commit 62cbd7f

Please sign in to comment.