mulmocast-viewer 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  **MulmoCast Viewer** is a Vue 3 component library for playing and displaying bundles (JSON and media files) generated by mulmocast-cli in a browser.
4
4
 
5
+ > **Note**: For application-specific features (ListView, Digest mode, mobile optimization, etc.), see [APP_FEATURES.md](./APP_FEATURES.md).
6
+
5
7
  ## Installation
6
8
 
7
9
  ```bash
@@ -148,6 +150,7 @@ MulmoViewer references media files (images, audio, video) relative to this `base
148
150
  | `initPage` | `number` | No | `0` | Initial page to display |
149
151
  | `audioLang` | `string` | No | `'en'` | Audio language |
150
152
  | `textLang` | `string` | No | `'en'` | Text language |
153
+ | `playbackSpeed` | `number` | No | `1` | Playback speed (1, 1.25, 1.5, 1.75, 2) |
151
154
 
152
155
  ### Events
153
156
 
@@ -1 +1 @@
1
- /*! tailwindcss v4.1.15 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-indigo-600:oklch(51.1% .262 276.966);--color-indigo-700:oklch(45.7% .24 277.023);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-800:oklch(27.8% .033 256.848);--color-black:#000;--color-white:#fff;--spacing:.25rem;--breakpoint-xl:80rem;--container-7xl:80rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-xl:1.25rem;--text-xl--line-height:calc(1.75/1.25);--font-weight-medium:500;--font-weight-bold:700;--radius-lg:.5rem;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.inset-0{inset:calc(var(--spacing)*0)}.right-8{right:calc(var(--spacing)*8)}.bottom-2{bottom:calc(var(--spacing)*2)}.bottom-8{bottom:calc(var(--spacing)*8)}.left-1\/2{left:50%}.z-50{z-index:50}.mx-auto{margin-inline:auto}.mt-1{margin-top:calc(var(--spacing)*1)}.mt-2{margin-top:calc(var(--spacing)*2)}.mt-4{margin-top:calc(var(--spacing)*4)}.flex{display:flex}.hidden{display:none}.inline-block{display:inline-block}.table{display:table}.h-4{height:calc(var(--spacing)*4)}.h-6\!{height:calc(var(--spacing)*6)!important}.h-auto{height:auto}.h-full{height:100%}.max-h-\[80vh\]{max-height:80vh}.max-h-full{max-height:100%}.w-4{width:calc(var(--spacing)*4)}.w-30{width:calc(var(--spacing)*30)}.w-auto{width:auto}.w-full{width:100%}.max-w-7xl{max-width:var(--container-7xl)}.max-w-full{max-width:100%}.max-w-screen-xl{max-width:var(--breakpoint-xl)}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.resize{resize:both}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-1{gap:calc(var(--spacing)*1)}.gap-2{gap:calc(var(--spacing)*2)}.gap-4{gap:calc(var(--spacing)*4)}.gap-8{gap:calc(var(--spacing)*8)}.overflow-hidden{overflow:hidden}.rounded{border-radius:.25rem}.rounded-lg{border-radius:var(--radius-lg)}.bg-black{background-color:var(--color-black)}.bg-black\/60{background-color:#0009}@supports (color:color-mix(in lab,red,red)){.bg-black\/60{background-color:color-mix(in oklab,var(--color-black)60%,transparent)}}.bg-gray-100{background-color:var(--color-gray-100)}.bg-gray-500{background-color:var(--color-gray-500)}.bg-gray-600{background-color:var(--color-gray-600)}.bg-indigo-600{background-color:var(--color-indigo-600)}.object-contain{object-fit:contain}.p-2{padding:calc(var(--spacing)*2)}.p-4{padding:calc(var(--spacing)*4)}.p-10{padding:calc(var(--spacing)*10)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-6{padding-inline:calc(var(--spacing)*6)}.py-1{padding-block:calc(var(--spacing)*1)}.py-2{padding-block:calc(var(--spacing)*2)}.py-3{padding-block:calc(var(--spacing)*3)}.text-center{text-align:center}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.text-gray-800{color:var(--color-gray-800)}.text-white{color:var(--color-white)}.opacity-0\!{opacity:0!important}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.filter{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}@media(hover:hover){.hover\:bg-black\/80:hover{background-color:#000c}@supports (color:color-mix(in lab,red,red)){.hover\:bg-black\/80:hover{background-color:color-mix(in oklab,var(--color-black)80%,transparent)}}.hover\:bg-gray-600:hover{background-color:var(--color-gray-600)}.hover\:bg-gray-800:hover{background-color:var(--color-gray-800)}.hover\:bg-indigo-700:hover{background-color:var(--color-indigo-700)}}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}}.mulmocast-video::-webkit-media-controls-enclosure{background-color:#00000080!important;border-radius:0!important}.mulmocast-video::-webkit-media-controls-current-time-display{-webkit-text-fill-color:#fff!important}.mulmocast-video::-webkit-media-controls-time-remaining-display{-webkit-text-fill-color:#fff!important}.mulmocast-video::-webkit-media-controls-play-button{filter:brightness(1.1)}.mulmocast-video::-webkit-media-controls-mute-button{filter:brightness(1.1)}.mulmocast-video::-webkit-media-controls-overlay-play-button{filter:brightness(1.1)}.mulmocast-video::-webkit-media-controls-fullscreen-button{filter:brightness(1.1)}.mulmocast-video::-webkit-media-controls{opacity:0;transition:opacity .3s}.mulmocast-video:hover::-webkit-media-controls{opacity:1}.mulmocast-audio::-webkit-media-controls-enclosure{background-color:#00000080!important;border-radius:0!important}.mulmocast-audio::-webkit-media-controls-current-time-display{-webkit-text-fill-color:#fff!important}.mulmocast-audio::-webkit-media-controls-time-remaining-display{-webkit-text-fill-color:#fff!important}.mulmocast-audio::-webkit-media-controls-play-button{filter:brightness(1.1)}.mulmocast-audio::-webkit-media-controls-mute-button{filter:brightness(1.1)}.mulmocast-audio::-webkit-media-controls{opacity:0;transition:opacity .3s}.mulmocast-audio:hover::-webkit-media-controls{opacity:1}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}
1
+ @layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-600:oklch(57.7% .245 27.325);--color-red-700:oklch(50.5% .213 27.518);--color-amber-600:oklch(66.6% .179 58.318);--color-amber-700:oklch(55.5% .163 48.998);--color-green-600:oklch(62.7% .194 149.214);--color-green-700:oklch(52.7% .154 150.069);--color-indigo-200:oklch(87% .065 274.039);--color-indigo-400:oklch(67.3% .182 276.935);--color-indigo-500:oklch(58.5% .233 277.117);--color-indigo-600:oklch(51.1% .262 276.966);--color-indigo-700:oklch(45.7% .24 277.023);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-800:oklch(27.8% .033 256.848);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-7xl:80rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75/1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2/1.5);--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-wide:.025em;--leading-relaxed:1.625;--radius-lg:.5rem;--radius-2xl:1rem;--aspect-video:16/9;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.sticky{position:sticky}.inset-0{inset:calc(var(--spacing)*0)}.top-0{top:calc(var(--spacing)*0)}.top-2{top:calc(var(--spacing)*2)}.right-0{right:calc(var(--spacing)*0)}.bottom-0{bottom:calc(var(--spacing)*0)}.bottom-2{bottom:calc(var(--spacing)*2)}.left-0{left:calc(var(--spacing)*0)}.left-1\/2{left:50%}.left-2{left:calc(var(--spacing)*2)}.z-50{z-index:50}.float-left{float:left}.clear-both{clear:both}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.mx-auto{margin-inline:auto}.mt-1{margin-top:calc(var(--spacing)*1)}.mt-2{margin-top:calc(var(--spacing)*2)}.mt-3{margin-top:calc(var(--spacing)*3)}.mt-4{margin-top:calc(var(--spacing)*4)}.mr-4{margin-right:calc(var(--spacing)*4)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.line-clamp-3{-webkit-line-clamp:3;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline-block{display:inline-block}.table{display:table}.aspect-video{aspect-ratio:var(--aspect-video)}.h-4{height:calc(var(--spacing)*4)}.h-6\!{height:calc(var(--spacing)*6)!important}.h-auto{height:auto}.h-full{height:100%}.max-h-\[80vh\]{max-height:80vh}.max-h-full{max-height:100%}.w-4{width:calc(var(--spacing)*4)}.w-30{width:calc(var(--spacing)*30)}.w-64{width:calc(var(--spacing)*64)}.w-auto{width:auto}.w-full{width:100%}.max-w-7xl{max-width:var(--container-7xl)}.max-w-full{max-width:100%}.flex-shrink-0{flex-shrink:0}.grow{flex-grow:1}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.cursor-pointer{cursor:pointer}.resize{resize:both}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-1{gap:calc(var(--spacing)*1)}.gap-2{gap:calc(var(--spacing)*2)}.gap-3{gap:calc(var(--spacing)*3)}.gap-4{gap:calc(var(--spacing)*4)}.gap-6{gap:calc(var(--spacing)*6)}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*4)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*6)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*6)*calc(1 - var(--tw-space-y-reverse)))}.overflow-hidden{overflow:hidden}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-t-2xl{border-top-left-radius:var(--radius-2xl);border-top-right-radius:var(--radius-2xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-gray-200{border-color:var(--color-gray-200)}.border-gray-300{border-color:var(--color-gray-300)}.bg-amber-600{background-color:var(--color-amber-600)}.bg-black{background-color:var(--color-black)}.bg-black\/60{background-color:#0009}@supports (color:color-mix(in lab,red,red)){.bg-black\/60{background-color:color-mix(in oklab,var(--color-black)60%,transparent)}}.bg-gray-200{background-color:var(--color-gray-200)}.bg-gray-500{background-color:var(--color-gray-500)}.bg-gray-600{background-color:var(--color-gray-600)}.bg-green-600{background-color:var(--color-green-600)}.bg-indigo-600{background-color:var(--color-indigo-600)}.bg-red-600{background-color:var(--color-red-600)}.bg-white{background-color:var(--color-white)}.object-contain{object-fit:contain}.object-cover{object-fit:cover}.p-2{padding:calc(var(--spacing)*2)}.p-4{padding:calc(var(--spacing)*4)}.p-6{padding:calc(var(--spacing)*6)}.p-10{padding:calc(var(--spacing)*10)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-6{padding-inline:calc(var(--spacing)*6)}.py-1{padding-block:calc(var(--spacing)*1)}.py-2{padding-block:calc(var(--spacing)*2)}.py-3{padding-block:calc(var(--spacing)*3)}.py-4{padding-block:calc(var(--spacing)*4)}.py-8{padding-block:calc(var(--spacing)*8)}.py-12{padding-block:calc(var(--spacing)*12)}.text-center{text-align:center}.text-left{text-align:left}.font-sans{font-family:var(--font-sans)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.text-gray-400{color:var(--color-gray-400)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-gray-700{color:var(--color-gray-700)}.text-gray-800{color:var(--color-gray-800)}.text-red-600{color:var(--color-red-600)}.text-white{color:var(--color-white)}.uppercase{text-transform:uppercase}.italic{font-style:italic}.opacity-0\!{opacity:0!important}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a),0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.filter{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-shadow{transition-property:box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-300{--tw-duration:.3s;transition-duration:.3s}@media(hover:hover){.group-hover\:text-indigo-600:is(:where(.group):hover *){color:var(--color-indigo-600)}.hover\:border-gray-400:hover{border-color:var(--color-gray-400)}.hover\:border-indigo-400:hover{border-color:var(--color-indigo-400)}.hover\:bg-amber-700:hover{background-color:var(--color-amber-700)}.hover\:bg-black\/80:hover{background-color:#000c}@supports (color:color-mix(in lab,red,red)){.hover\:bg-black\/80:hover{background-color:color-mix(in oklab,var(--color-black)80%,transparent)}}.hover\:bg-gray-600:hover{background-color:var(--color-gray-600)}.hover\:bg-gray-700:hover{background-color:var(--color-gray-700)}.hover\:bg-green-700:hover{background-color:var(--color-green-700)}.hover\:bg-indigo-700:hover{background-color:var(--color-indigo-700)}.hover\:bg-red-700:hover{background-color:var(--color-red-700)}.hover\:text-gray-700:hover{color:var(--color-gray-700)}.hover\:opacity-80:hover{opacity:.8}.hover\:shadow-lg:hover{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-xl:hover{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a),0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}}.focus\:border-indigo-500:focus{border-color:var(--color-indigo-500)}.focus\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-indigo-200:focus{--tw-ring-color:var(--color-indigo-200)}.focus\:ring-indigo-500:focus{--tw-ring-color:var(--color-indigo-500)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.disabled\:opacity-50:disabled{opacity:.5}@media(min-width:40rem){.sm\:block{display:block}.sm\:flex{display:flex}.sm\:hidden{display:none}.sm\:inline-block{display:inline-block}.sm\:w-auto{width:auto}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:items-center{align-items:center}.sm\:gap-4{gap:calc(var(--spacing)*4)}.sm\:py-4{padding-block:calc(var(--spacing)*4)}.sm\:text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}}@media(min-width:64rem){.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:flex-row{flex-direction:row}.lg\:items-center{align-items:center}}@media(min-width:80rem){.xl\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}}.mulmocast-video::-webkit-media-controls-enclosure{background-color:#00000080!important;border-radius:0!important}.mulmocast-video::-webkit-media-controls-current-time-display{-webkit-text-fill-color:#fff!important}.mulmocast-video::-webkit-media-controls-time-remaining-display{-webkit-text-fill-color:#fff!important}.mulmocast-video::-webkit-media-controls-play-button{filter:brightness(1.1)}.mulmocast-video::-webkit-media-controls-mute-button{filter:brightness(1.1)}.mulmocast-video::-webkit-media-controls-overlay-play-button{filter:brightness(1.1)}.mulmocast-video::-webkit-media-controls-fullscreen-button{filter:brightness(1.1)}.mulmocast-video::-webkit-media-controls{opacity:0;transition:opacity .3s}.mulmocast-video:hover::-webkit-media-controls{opacity:1}.mulmocast-audio::-webkit-media-controls-enclosure{background-color:#00000080!important;border-radius:0!important}.mulmocast-audio::-webkit-media-controls-current-time-display{-webkit-text-fill-color:#fff!important}.mulmocast-audio::-webkit-media-controls-time-remaining-display{-webkit-text-fill-color:#fff!important}.mulmocast-audio::-webkit-media-controls-play-button{filter:brightness(1.1)}.mulmocast-audio::-webkit-media-controls-mute-button{filter:brightness(1.1)}.mulmocast-audio::-webkit-media-controls{opacity:0;transition:opacity .3s}.mulmocast-audio:hover::-webkit-media-controls{opacity:1}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}
@@ -1,14 +1,20 @@
1
- import { defineComponent as $, ref as m, createElementBlock as i, openBlock as u, createTextVNode as H, createElementVNode as d, createCommentVNode as R, toDisplayString as C, Fragment as N, renderList as I, computed as x, renderSlot as O, withDirectives as q, normalizeProps as W, guardReactiveProps as G, createVNode as J, mergeProps as j, unref as K, createBlock as Q, vShow as U } from "vue";
2
- const B = async (t) => await new Promise((S) => setTimeout(S, t)), X = { class: "items-center justify-center w-full" }, Y = { key: 0 }, Z = ["src"], ee = {
1
+ import { defineComponent as F, ref as p, watch as E, onMounted as I, onUnmounted as U, createElementBlock as r, openBlock as d, createCommentVNode as $, createElementVNode as g, toDisplayString as D, Fragment as H, renderList as q, computed as L, renderSlot as G, withDirectives as J, normalizeProps as M, guardReactiveProps as K, createVNode as Q, mergeProps as z, unref as X, createBlock as Y, vShow as Z } from "vue";
2
+ const W = async (u) => await new Promise((P) => setTimeout(P, u)), ee = { class: "items-center justify-center w-full" }, ae = { key: 0 }, te = ["src"], ue = {
3
3
  key: 1,
4
4
  class: "relative inline-block"
5
- }, ae = ["src"], te = ["src"], oe = {
5
+ }, oe = ["src"], ne = ["src"], le = {
6
6
  key: 2,
7
7
  class: "relative inline-block"
8
- }, ue = ["src"], ne = ["src"], ie = {
8
+ }, ie = ["src"], se = ["src"], de = {
9
9
  key: 3,
10
10
  class: "relative inline-block"
11
- }, le = ["src"], se = { key: 4 }, ce = "https://github.com/receptron/mulmocast-cli/blob/main/assets/images/mulmocast_credit.png?raw=true", L = /* @__PURE__ */ $({
11
+ }, ce = ["src"], re = { key: 4 }, ve = {
12
+ key: 5,
13
+ class: "mt-4 px-6 py-4 text-left"
14
+ }, ge = { class: "text-lg leading-relaxed font-sans text-gray-800" }, fe = {
15
+ key: 0,
16
+ class: "text-base leading-relaxed font-sans text-gray-400 mt-3 italic"
17
+ }, me = "https://github.com/receptron/mulmocast-cli/blob/main/assets/images/mulmocast_credit.png?raw=true", N = /* @__PURE__ */ F({
12
18
  __name: "mulmo_player",
13
19
  props: {
14
20
  index: {},
@@ -18,234 +24,310 @@ const B = async (t) => await new Promise((S) => setTimeout(S, t)), X = { class:
18
24
  imageSource: {},
19
25
  audioSource: {},
20
26
  text: {},
21
- duration: {}
27
+ originalText: {},
28
+ duration: {},
29
+ defaultLang: {},
30
+ currentLang: {},
31
+ playbackSpeed: { default: 1 }
22
32
  },
23
33
  emits: ["play", "pause", "ended"],
24
- setup(t, { expose: S, emit: _ }) {
25
- const n = t, c = _, l = m(), a = m(), o = m(), g = m(), f = m(), p = () => {
26
- o.value && a.value && (o.value.currentTime = a.value.currentTime, o.value.currentTime === a.value.currentTime && o.value.play()), c("play");
27
- }, k = (v) => {
28
- !a.value?.ended && o?.value && o.value?.pause(), console.log(v), b(v);
29
- }, w = () => {
30
- !o.value?.paused && !o.value?.ended && (o.value?.currentTime ?? 0) > 0 || P();
31
- }, r = () => {
32
- !a.value?.paused && !a.value?.ended && (a.value?.currentTime ?? 0) > 0 || P();
33
- }, h = () => {
34
- c("play");
35
- }, b = (v) => {
36
- const y = v.target;
37
- y.duration !== y.currentTime && c("pause");
38
- }, P = () => {
39
- c("ended");
34
+ setup(u, { expose: P, emit: _ }) {
35
+ const t = u, f = _, l = p(), a = p(), o = p(), n = p(), b = p(), S = () => {
36
+ a.value && t.videoSource && (t.audioSource && t.currentLang && t.defaultLang && t.currentLang !== t.defaultLang ? a.value.volume = 0.2 : a.value.volume = 0);
37
+ }, m = () => {
38
+ const i = t.playbackSpeed ?? 1;
39
+ l.value && (l.value.playbackRate = i), a.value && (a.value.playbackRate = i), o.value && (o.value.playbackRate = i), n.value && (n.value.playbackRate = i);
40
40
  };
41
- return S({
42
- play: async () => {
43
- l.value && l.value.play(), a.value && a.value.play(), g.value && g.value.play(), !l.value && !a.value && !g.value && (await B((n.duration ?? 0) * 1e3), c("ended"));
41
+ E(
42
+ [
43
+ () => t.currentLang,
44
+ () => t.defaultLang,
45
+ () => t.videoSource,
46
+ () => t.audioSource
47
+ ],
48
+ () => {
49
+ S();
50
+ }
51
+ ), E(
52
+ () => t.playbackSpeed,
53
+ () => {
54
+ m();
44
55
  }
45
- }), (v, y) => (u(), i("div", X, [
46
- t.videoWithAudioSource ? (u(), i("div", Y, [
47
- d("video", {
56
+ ), E(a, (i) => {
57
+ i && (S(), m());
58
+ }), E([l, o, n], () => {
59
+ m();
60
+ }), I(() => {
61
+ S(), m();
62
+ });
63
+ const C = () => {
64
+ c.value = !0, o.value && a.value && (o.value.currentTime = a.value.currentTime, o.value.currentTime === a.value.currentTime && o.value.play()), f("play");
65
+ }, x = (i) => {
66
+ document.hidden || (c.value = !1), !a.value?.ended && o?.value && o.value?.pause(), console.log(i), w(i);
67
+ }, v = () => {
68
+ !o.value?.paused && !o.value?.ended && (o.value?.currentTime ?? 0) > 0 || k();
69
+ }, A = () => {
70
+ !a.value?.paused && !a.value?.ended && (a.value?.currentTime ?? 0) > 0 || k();
71
+ }, R = () => {
72
+ c.value = !0, f("play");
73
+ }, w = (i) => {
74
+ document.hidden || (c.value = !1);
75
+ const e = i.target;
76
+ e.duration !== e.currentTime && f("pause");
77
+ }, k = () => {
78
+ c.value = !1, f("ended");
79
+ }, c = p(!1);
80
+ let y = null;
81
+ const B = async () => {
82
+ c.value = !0, l.value && (m(), l.value.play()), a.value && (S(), m(), a.value.play(), o.value && (o.value.currentTime = a.value.currentTime, o.value.play())), n.value && (m(), n.value.play()), !l.value && !a.value && !n.value && (await W((t.duration ?? 0) * 1e3), c.value = !1, f("ended"));
83
+ }, T = () => {
84
+ c.value && (l.value?.paused && l.value.play().catch(() => {
85
+ }), a.value?.paused && a.value.play().catch(() => {
86
+ }), n.value?.paused && n.value.play().catch(() => {
87
+ }), o.value?.paused && o.value.play().catch(() => {
88
+ }));
89
+ }, j = () => {
90
+ document.hidden && c.value ? y || (y = setInterval(T, 500)) : document.hidden || y && (clearInterval(y), y = null);
91
+ }, h = () => {
92
+ document.hidden && c.value && setTimeout(T, 50);
93
+ };
94
+ return I(() => {
95
+ document.addEventListener("visibilitychange", j), l.value?.addEventListener("pause", h), a.value?.addEventListener("pause", h), n.value?.addEventListener("pause", h), o.value?.addEventListener("pause", h);
96
+ }), U(() => {
97
+ document.removeEventListener("visibilitychange", j), l.value?.removeEventListener("pause", h), a.value?.removeEventListener("pause", h), n.value?.removeEventListener("pause", h), o.value?.removeEventListener("pause", h), y && (clearInterval(y), y = null);
98
+ }), P({
99
+ play: B
100
+ }), (i, e) => (d(), r("div", ee, [
101
+ u.videoWithAudioSource ? (d(), r("div", ae, [
102
+ g("video", {
48
103
  ref_key: "videoWithAudioRef",
49
104
  ref: l,
50
- src: t.videoWithAudioSource,
105
+ src: u.videoWithAudioSource,
51
106
  class: "mulmocast-video mx-auto h-auto max-h-[80vh] w-auto object-contain",
52
107
  controls: !0,
53
108
  playsinline: "true",
54
- onPlay: h,
55
- onPause: b,
56
- onEnded: P
57
- }, null, 40, Z)
58
- ])) : t.soundEffectSource || t.videoSource ? (u(), i("div", ee, [
59
- d("video", {
109
+ onPlay: R,
110
+ onPause: w,
111
+ onEnded: k
112
+ }, null, 40, te)
113
+ ])) : u.soundEffectSource || u.videoSource ? (d(), r("div", ue, [
114
+ g("video", {
60
115
  ref_key: "videoRef",
61
116
  ref: a,
62
117
  class: "mulmocast-video mx-auto h-auto max-h-[80vh] w-auto object-contain",
63
- src: t.soundEffectSource || t.videoSource,
118
+ src: u.soundEffectSource || u.videoSource,
64
119
  controls: !0,
65
120
  playsinline: "true",
66
- onPlay: p,
67
- onPause: k,
68
- onEnded: w
69
- }, null, 40, ae),
70
- t.audioSource ? (u(), i("audio", {
121
+ onPlay: C,
122
+ onPause: x,
123
+ onEnded: v
124
+ }, null, 40, oe),
125
+ u.audioSource ? (d(), r("audio", {
71
126
  key: 0,
72
127
  ref_key: "audioSyncRef",
73
128
  ref: o,
74
- src: t.audioSource,
129
+ src: u.audioSource,
75
130
  controls: !0,
76
131
  class: "hidden",
77
- onEnded: r
78
- }, null, 40, te)) : R("", !0)
79
- ])) : t.audioSource ? (u(), i("div", oe, [
80
- t.imageSource ? (u(), i("img", {
132
+ onEnded: A
133
+ }, null, 40, ne)) : $("", !0)
134
+ ])) : u.audioSource ? (d(), r("div", le, [
135
+ u.imageSource ? (d(), r("img", {
81
136
  key: 0,
82
- src: t.imageSource,
137
+ src: u.imageSource,
83
138
  class: "mx-auto h-auto max-h-[80vh] w-auto object-contain",
84
139
  alt: "Background"
85
- }, null, 8, ue)) : (u(), i("img", {
140
+ }, null, 8, ie)) : (d(), r("img", {
86
141
  key: 1,
87
- src: ce,
142
+ src: me,
88
143
  class: "mx-auto h-auto max-h-[80vh] w-auto object-contain",
89
144
  alt: "Background"
90
145
  })),
91
- d("audio", {
146
+ g("audio", {
92
147
  ref_key: "audioRef",
93
- ref: g,
148
+ ref: n,
94
149
  class: "mulmocast-audio absolute inset-0 w-full h-full",
95
- src: t.audioSource,
150
+ src: u.audioSource,
96
151
  controls: !0,
97
- onPlay: h,
98
- onPause: b,
99
- onEnded: P
100
- }, null, 40, ne)
101
- ])) : t.imageSource ? (u(), i("div", ie, [
102
- d("img", {
152
+ onPlay: R,
153
+ onPause: w,
154
+ onEnded: k
155
+ }, null, 40, se)
156
+ ])) : u.imageSource ? (d(), r("div", de, [
157
+ g("img", {
103
158
  ref_key: "imageRef",
104
- ref: f,
105
- src: t.imageSource,
159
+ ref: b,
160
+ src: u.imageSource,
106
161
  class: "max-w-full max-h-full object-contain"
107
- }, null, 8, le)
108
- ])) : (u(), i("div", se, "No media available")),
109
- H(" " + C(t.text), 1)
162
+ }, null, 8, ce)
163
+ ])) : (d(), r("div", re, "No media available")),
164
+ u.text ? (d(), r("div", ve, [
165
+ g("p", ge, D(u.text), 1),
166
+ u.originalText && u.originalText !== u.text ? (d(), r("p", fe, D(u.originalText), 1)) : $("", !0)
167
+ ])) : $("", !0)
110
168
  ]));
111
169
  }
112
- }), de = ["value"], re = ["value"], ve = /* @__PURE__ */ $({
170
+ }), ye = ["value"], he = ["value"], pe = /* @__PURE__ */ F({
113
171
  __name: "select_language",
114
172
  props: {
115
173
  modelValue: {}
116
174
  },
117
175
  emits: ["update:modelValue"],
118
- setup(t, { emit: S }) {
119
- const _ = ["en", "ja"], n = S, c = (l) => {
120
- const a = l.target;
121
- n("update:modelValue", a.value);
176
+ setup(u, { emit: P }) {
177
+ const _ = ["en", "ja"], t = {
178
+ en: "English",
179
+ ja: "日本語"
180
+ }, f = P, l = (a) => {
181
+ const o = a.target;
182
+ f("update:modelValue", o.value);
122
183
  };
123
- return (l, a) => (u(), i("select", {
124
- value: t.modelValue,
125
- onChange: c
184
+ return (a, o) => (d(), r("select", {
185
+ value: u.modelValue,
186
+ class: "px-4 py-2 bg-white border-2 border-gray-300 rounded-lg shadow-sm hover:border-indigo-400 focus:border-indigo-500 focus:ring-2 focus:ring-indigo-200 focus:outline-none transition-colors cursor-pointer text-base font-medium text-gray-700",
187
+ onChange: l
126
188
  }, [
127
- (u(), i(N, null, I(_, (o) => d("option", {
128
- key: o,
129
- value: o
130
- }, C(o), 9, re)), 64))
131
- ], 40, de));
189
+ (d(), r(H, null, q(_, (n) => g("option", {
190
+ key: n,
191
+ value: n
192
+ }, D(t[n] || n), 9, he)), 64))
193
+ ], 40, ye));
132
194
  }
133
- }), me = { class: "w-full overflow-hidden" }, ge = { class: "max-w-7xl mx-auto px-4" }, fe = { class: "flex items-center justify-between" }, he = ["disabled"], ye = { class: "px-4" }, Se = ["disabled"], Pe = ["src"], pe = /* @__PURE__ */ $({
195
+ }), Se = { class: "w-full overflow-hidden" }, xe = { class: "max-w-7xl mx-auto px-4" }, be = { class: "flex items-center justify-between" }, Pe = ["disabled"], ke = { class: "px-4" }, Le = ["disabled"], we = ["src"], _e = /* @__PURE__ */ F({
134
196
  __name: "mulmo_viewer",
135
197
  props: {
136
198
  dataSet: {},
137
199
  basePath: {},
138
200
  initPage: {},
139
201
  audioLang: { default: "en" },
140
- textLang: { default: "en" }
202
+ textLang: { default: "en" },
203
+ playbackSpeed: { default: 1 }
141
204
  },
142
205
  emits: ["updatedPage", "update:audioLang", "update:textLang"],
143
- setup(t, { expose: S, emit: _ }) {
144
- const n = t, c = _, l = n.dataSet?.beats?.length ?? 0, a = m(n.initPage ?? 0), o = m(!0), g = m(), f = m(), p = x({
145
- get: () => n.audioLang,
146
- set: (e) => c("update:audioLang", e || "en")
147
- }), k = x({
148
- get: () => n.textLang,
149
- set: (e) => c("update:textLang", e || "en")
150
- }), w = x(() => n.dataSet?.beats[a.value]), r = (e) => e ? n.basePath + "/" + e : "", h = m(!1), b = () => {
151
- h.value = !0, f.value && f.value.play();
152
- }, P = () => {
153
- console.log("pause"), h.value = !1, f.value && f.value.pause();
154
- }, E = async () => {
155
- await B(500), g.value && g.value.play();
156
- }, v = (e) => {
157
- a.value !== e && (a.value = e, h.value && o.value && E());
158
- }, y = (e) => {
206
+ setup(u, { expose: P, emit: _ }) {
207
+ const t = u, f = _, l = t.dataSet?.beats?.length ?? 0, a = p(t.initPage ?? 0), o = p(!0), n = p(), b = p(), S = L({
208
+ get: () => t.audioLang,
209
+ set: (e) => f("update:audioLang", e || "en")
210
+ }), m = L({
211
+ get: () => t.textLang,
212
+ set: (e) => f("update:textLang", e || "en")
213
+ });
214
+ E(
215
+ () => t.audioLang,
216
+ async (e, s) => {
217
+ if (e !== s && v.value) {
218
+ const V = v.value;
219
+ v.value = !1, await W(500), V && n.value && (v.value = !0, await n.value.play());
220
+ }
221
+ }
222
+ ), E(
223
+ () => t.textLang,
224
+ async (e, s) => {
225
+ e !== s && v.value && (await W(100), n.value && await n.value.play());
226
+ }
227
+ );
228
+ const C = L(() => t.dataSet?.beats[a.value]), x = (e) => e ? t.basePath + "/" + e : "", v = p(!1), A = () => {
229
+ v.value = !0, b.value && b.value.play();
230
+ }, R = () => {
231
+ console.log("pause"), v.value = !1, b.value && b.value.pause();
232
+ }, w = async () => {
233
+ await W(500), n.value && n.value.play();
234
+ }, k = (e) => {
235
+ a.value !== e && (a.value = e, v.value && o.value && w());
236
+ }, c = (e) => {
159
237
  const s = a.value + e;
160
- return s > -1 && s < l ? (v(s), c("updatedPage", s), !0) : !1;
161
- }, V = () => {
162
- console.log("end"), o.value && y(1) ? E() : (h.value = !1, f.value && f.value.pause());
163
- }, D = {
164
- onPlay: b,
165
- onPause: P,
166
- onEnded: V
167
- }, A = x(() => {
168
- const e = w.value, s = e?.audioSources?.[p.value];
238
+ return s > -1 && s < l ? (k(s), f("updatedPage", s), !0) : !1;
239
+ }, y = () => {
240
+ console.log("end"), o.value && c(1) ? w() : (v.value = !1, b.value && b.value.pause());
241
+ }, B = {
242
+ onPlay: A,
243
+ onPause: R,
244
+ onEnded: y
245
+ }, T = L(() => {
246
+ const e = C.value, s = e?.audioSources?.[S.value], V = e?.multiLinguals?.[m.value] ?? e?.text ?? "", O = t.dataSet?.lang ? e?.multiLinguals?.[t.dataSet.lang] ?? e?.text ?? "" : "";
169
247
  return {
170
- videoWithAudioSource: r(e?.videoWithAudioSource),
171
- videoSource: r(e?.videoSource),
172
- soundEffectSource: r(e?.soundEffectSource),
173
- audioSource: s ? n.basePath + "/" + s : "",
174
- imageSource: r(e?.imageSource),
248
+ videoWithAudioSource: x(e?.videoWithAudioSource),
249
+ videoSource: x(e?.videoSource),
250
+ soundEffectSource: x(e?.soundEffectSource),
251
+ audioSource: s ? t.basePath + "/" + s : "",
252
+ imageSource: x(e?.imageSource),
175
253
  index: a.value,
176
- text: e?.multiLinguals?.[k.value] ?? e?.text ?? "",
254
+ text: V,
255
+ originalText: O,
177
256
  duration: e?.duration,
178
- ...D
257
+ defaultLang: t.dataSet?.lang,
258
+ currentLang: S.value,
259
+ playbackSpeed: t.playbackSpeed,
260
+ ...B
179
261
  };
180
- }), F = x(() => n.dataSet?.beats[a.value + 1]), T = x(() => {
262
+ }), j = L(() => t.dataSet?.beats[a.value + 1]), h = L(() => {
181
263
  if (a.value + 1 >= l) return null;
182
- const e = F.value;
264
+ const e = j.value;
183
265
  return {
184
- videoWithAudioSource: r(e?.videoWithAudioSource),
185
- videoSource: r(e?.videoSource),
186
- soundEffectSource: r(e?.soundEffectSource),
187
- audioSource: e?.audioSources?.[p.value] ? n.basePath + "/" + e.audioSources[p.value] : "",
188
- imageSource: r(e?.imageSource),
266
+ videoWithAudioSource: x(e?.videoWithAudioSource),
267
+ videoSource: x(e?.videoSource),
268
+ soundEffectSource: x(e?.soundEffectSource),
269
+ audioSource: e?.audioSources?.[S.value] ? t.basePath + "/" + e.audioSources[S.value] : "",
270
+ imageSource: x(e?.imageSource),
189
271
  index: a.value + 1,
190
- text: e?.multiLinguals?.[k.value] ?? e?.text ?? "",
272
+ text: e?.multiLinguals?.[m.value] ?? e?.text ?? "",
191
273
  duration: e?.duration
192
274
  };
193
- }), M = x(() => ({
194
- MulmoPlayer: L,
195
- pageProps: A.value,
275
+ }), i = L(() => ({
276
+ MulmoPlayer: N,
277
+ pageProps: T.value,
196
278
  currentPage: a.value,
197
279
  pageCount: l,
198
- pageMove: y,
199
- isPlaying: h.value,
200
- audioLang: p,
201
- textLang: k,
202
- SelectLanguage: ve,
203
- mediaPlayerRef: g,
280
+ pageMove: c,
281
+ isPlaying: v.value,
282
+ audioLang: S,
283
+ textLang: m,
284
+ SelectLanguage: pe,
285
+ mediaPlayerRef: n,
204
286
  // Event handlers for direct access
205
- handlePlay: b,
206
- handlePause: P,
207
- handleEnded: V
287
+ handlePlay: A,
288
+ handlePause: R,
289
+ handleEnded: y
208
290
  }));
209
- return S({
210
- updatePage: v
211
- }), (e, s) => (u(), i(N, null, [
212
- O(e.$slots, "default", W(G(M.value)), () => [
213
- d("div", me, [
214
- d("div", ge, [
215
- d("div", fe, [
216
- d("button", {
291
+ return P({
292
+ updatePage: k
293
+ }), (e, s) => (d(), r(H, null, [
294
+ G(e.$slots, "default", M(K(i.value)), () => [
295
+ g("div", Se, [
296
+ g("div", xe, [
297
+ g("div", be, [
298
+ g("button", {
217
299
  class: "px-4 py-2 bg-gray-500 text-white rounded hover:bg-gray-600 disabled:opacity-50",
218
300
  disabled: a.value === 0,
219
- onClick: s[0] || (s[0] = (z) => y(-1))
220
- }, " Prev ", 8, he),
221
- d("div", ye, [
222
- J(L, j({
301
+ onClick: s[0] || (s[0] = (V) => c(-1))
302
+ }, " Prev ", 8, Pe),
303
+ g("div", ke, [
304
+ Q(N, z({
223
305
  ref_key: "mediaPlayer",
224
- ref: g
225
- }, A.value), null, 16)
306
+ ref: n
307
+ }, T.value), null, 16)
226
308
  ]),
227
- d("button", {
309
+ g("button", {
228
310
  class: "px-4 py-2 bg-gray-500 text-white rounded hover:bg-gray-600 disabled:opacity-50",
229
- disabled: a.value >= K(l) - 1,
230
- onClick: s[1] || (s[1] = (z) => y(1))
231
- }, " Next ", 8, Se)
311
+ disabled: a.value >= X(l) - 1,
312
+ onClick: s[1] || (s[1] = (V) => c(1))
313
+ }, " Next ", 8, Le)
232
314
  ])
233
315
  ])
234
316
  ])
235
317
  ]),
236
- T.value ? q((u(), Q(L, W(j({ key: 0 }, T.value)), null, 16)), [
237
- [U, !1]
238
- ]) : R("", !0),
239
- t.dataSet?.bgmFile ? (u(), i("audio", {
318
+ h.value ? J((d(), Y(N, M(z({ key: 0 }, h.value)), null, 16)), [
319
+ [Z, !1]
320
+ ]) : $("", !0),
321
+ u.dataSet?.bgmFile ? (d(), r("audio", {
240
322
  key: 1,
241
323
  ref_key: "bgmRef",
242
- ref: f,
243
- src: t.dataSet?.bgmFile
244
- }, null, 8, Pe)) : R("", !0)
324
+ ref: b,
325
+ src: u.dataSet?.bgmFile
326
+ }, null, 8, we)) : $("", !0)
245
327
  ], 64));
246
328
  }
247
329
  });
248
330
  export {
249
- pe as MulmoViewer,
250
- ve as SelectLanguage
331
+ _e as MulmoViewer,
332
+ pe as SelectLanguage
251
333
  };
@@ -1 +1 @@
1
- (function(f,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(f=typeof globalThis<"u"?globalThis:f||self,e(f.MulmoCastViewer={},f.Vue))})(this,(function(f,e){"use strict";const _=async a=>await new Promise(y=>setTimeout(y,a)),L={class:"items-center justify-center w-full"},R={key:0},$=["src"],C={key:1,class:"relative inline-block"},T=["src"],A=["src"],j={key:2,class:"relative inline-block"},W=["src"],D=["src"],M={key:3,class:"relative inline-block"},F=["src"],z={key:4},O="https://github.com/receptron/mulmocast-cli/blob/main/assets/images/mulmocast_credit.png?raw=true",x=e.defineComponent({__name:"mulmo_player",props:{index:{},videoWithAudioSource:{},soundEffectSource:{},videoSource:{},imageSource:{},audioSource:{},text:{},duration:{}},emits:["play","pause","ended"],setup(a,{expose:y,emit:k}){const l=a,d=k,c=e.ref(),o=e.ref(),n=e.ref(),r=e.ref(),m=e.ref(),S=()=>{n.value&&o.value&&(n.value.currentTime=o.value.currentTime,n.value.currentTime===o.value.currentTime&&n.value.play()),d("play")},v=u=>{!o.value?.ended&&n?.value&&n.value?.pause(),console.log(u),P(u)},E=()=>{!n.value?.paused&&!n.value?.ended&&(n.value?.currentTime??0)>0||p()},s=()=>{!o.value?.paused&&!o.value?.ended&&(o.value?.currentTime??0)>0||p()},g=()=>{d("play")},P=u=>{const h=u.target;h.duration!==h.currentTime&&d("pause")},p=()=>{d("ended")};return y({play:async()=>{c.value&&c.value.play(),o.value&&o.value.play(),r.value&&r.value.play(),!c.value&&!o.value&&!r.value&&(await _((l.duration??0)*1e3),d("ended"))}}),(u,h)=>(e.openBlock(),e.createElementBlock("div",L,[a.videoWithAudioSource?(e.openBlock(),e.createElementBlock("div",R,[e.createElementVNode("video",{ref_key:"videoWithAudioRef",ref:c,src:a.videoWithAudioSource,class:"mulmocast-video mx-auto h-auto max-h-[80vh] w-auto object-contain",controls:!0,playsinline:"true",onPlay:g,onPause:P,onEnded:p},null,40,$)])):a.soundEffectSource||a.videoSource?(e.openBlock(),e.createElementBlock("div",C,[e.createElementVNode("video",{ref_key:"videoRef",ref:o,class:"mulmocast-video mx-auto h-auto max-h-[80vh] w-auto object-contain",src:a.soundEffectSource||a.videoSource,controls:!0,playsinline:"true",onPlay:S,onPause:v,onEnded:E},null,40,T),a.audioSource?(e.openBlock(),e.createElementBlock("audio",{key:0,ref_key:"audioSyncRef",ref:n,src:a.audioSource,controls:!0,class:"hidden",onEnded:s},null,40,A)):e.createCommentVNode("",!0)])):a.audioSource?(e.openBlock(),e.createElementBlock("div",j,[a.imageSource?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.imageSource,class:"mx-auto h-auto max-h-[80vh] w-auto object-contain",alt:"Background"},null,8,W)):(e.openBlock(),e.createElementBlock("img",{key:1,src:O,class:"mx-auto h-auto max-h-[80vh] w-auto object-contain",alt:"Background"})),e.createElementVNode("audio",{ref_key:"audioRef",ref:r,class:"mulmocast-audio absolute inset-0 w-full h-full",src:a.audioSource,controls:!0,onPlay:g,onPause:P,onEnded:p},null,40,D)])):a.imageSource?(e.openBlock(),e.createElementBlock("div",M,[e.createElementVNode("img",{ref_key:"imageRef",ref:m,src:a.imageSource,class:"max-w-full max-h-full object-contain"},null,8,F)])):(e.openBlock(),e.createElementBlock("div",z,"No media available")),e.createTextVNode(" "+e.toDisplayString(a.text),1)]))}}),q=["value"],H=["value"],B=e.defineComponent({__name:"select_language",props:{modelValue:{}},emits:["update:modelValue"],setup(a,{emit:y}){const k=["en","ja"],l=y,d=c=>{const o=c.target;l("update:modelValue",o.value)};return(c,o)=>(e.openBlock(),e.createElementBlock("select",{value:a.modelValue,onChange:d},[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(k,n=>e.createElementVNode("option",{key:n,value:n},e.toDisplayString(n),9,H)),64))],40,q))}}),I={class:"w-full overflow-hidden"},G={class:"max-w-7xl mx-auto px-4"},J={class:"flex items-center justify-between"},K=["disabled"],Q={class:"px-4"},U=["disabled"],X=["src"],Y=e.defineComponent({__name:"mulmo_viewer",props:{dataSet:{},basePath:{},initPage:{},audioLang:{default:"en"},textLang:{default:"en"}},emits:["updatedPage","update:audioLang","update:textLang"],setup(a,{expose:y,emit:k}){const l=a,d=k,c=l.dataSet?.beats?.length??0,o=e.ref(l.initPage??0),n=e.ref(!0),r=e.ref(),m=e.ref(),S=e.computed({get:()=>l.audioLang,set:t=>d("update:audioLang",t||"en")}),v=e.computed({get:()=>l.textLang,set:t=>d("update:textLang",t||"en")}),E=e.computed(()=>l.dataSet?.beats[o.value]),s=t=>t?l.basePath+"/"+t:"",g=e.ref(!1),P=()=>{g.value=!0,m.value&&m.value.play()},p=()=>{console.log("pause"),g.value=!1,m.value&&m.value.pause()},b=async()=>{await _(500),r.value&&r.value.play()},u=t=>{o.value!==t&&(o.value=t,g.value&&n.value&&b())},h=t=>{const i=o.value+t;return i>-1&&i<c?(u(i),d("updatedPage",i),!0):!1},V=()=>{console.log("end"),n.value&&h(1)?b():(g.value=!1,m.value&&m.value.pause())},Z={onPlay:P,onPause:p,onEnded:V},w=e.computed(()=>{const t=E.value,i=t?.audioSources?.[S.value];return{videoWithAudioSource:s(t?.videoWithAudioSource),videoSource:s(t?.videoSource),soundEffectSource:s(t?.soundEffectSource),audioSource:i?l.basePath+"/"+i:"",imageSource:s(t?.imageSource),index:o.value,text:t?.multiLinguals?.[v.value]??t?.text??"",duration:t?.duration,...Z}}),ee=e.computed(()=>l.dataSet?.beats[o.value+1]),N=e.computed(()=>{if(o.value+1>=c)return null;const t=ee.value;return{videoWithAudioSource:s(t?.videoWithAudioSource),videoSource:s(t?.videoSource),soundEffectSource:s(t?.soundEffectSource),audioSource:t?.audioSources?.[S.value]?l.basePath+"/"+t.audioSources[S.value]:"",imageSource:s(t?.imageSource),index:o.value+1,text:t?.multiLinguals?.[v.value]??t?.text??"",duration:t?.duration}}),te=e.computed(()=>({MulmoPlayer:x,pageProps:w.value,currentPage:o.value,pageCount:c,pageMove:h,isPlaying:g.value,audioLang:S,textLang:v,SelectLanguage:B,mediaPlayerRef:r,handlePlay:P,handlePause:p,handleEnded:V}));return y({updatePage:u}),(t,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.renderSlot(t.$slots,"default",e.normalizeProps(e.guardReactiveProps(te.value)),()=>[e.createElementVNode("div",I,[e.createElementVNode("div",G,[e.createElementVNode("div",J,[e.createElementVNode("button",{class:"px-4 py-2 bg-gray-500 text-white rounded hover:bg-gray-600 disabled:opacity-50",disabled:o.value===0,onClick:i[0]||(i[0]=oe=>h(-1))}," Prev ",8,K),e.createElementVNode("div",Q,[e.createVNode(x,e.mergeProps({ref_key:"mediaPlayer",ref:r},w.value),null,16)]),e.createElementVNode("button",{class:"px-4 py-2 bg-gray-500 text-white rounded hover:bg-gray-600 disabled:opacity-50",disabled:o.value>=e.unref(c)-1,onClick:i[1]||(i[1]=oe=>h(1))}," Next ",8,U)])])])]),N.value?e.withDirectives((e.openBlock(),e.createBlock(x,e.normalizeProps(e.mergeProps({key:0},N.value)),null,16)),[[e.vShow,!1]]):e.createCommentVNode("",!0),a.dataSet?.bgmFile?(e.openBlock(),e.createElementBlock("audio",{key:1,ref_key:"bgmRef",ref:m,src:a.dataSet?.bgmFile},null,8,X)):e.createCommentVNode("",!0)],64))}});f.MulmoViewer=Y,f.SelectLanguage=B,Object.defineProperty(f,Symbol.toStringTag,{value:"Module"})}));
1
+ (function(k,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(k=typeof globalThis<"u"?globalThis:k||self,e(k.MulmoCastViewer={},k.Vue))})(this,(function(k,e){"use strict";const B=async n=>await new Promise(S=>setTimeout(S,n)),$={class:"items-center justify-center w-full"},A={key:0},j=["src"],W={key:1,class:"relative inline-block"},M=["src"],D=["src"],F={key:2,class:"relative inline-block"},I=["src"],z=["src"],O={key:3,class:"relative inline-block"},q=["src"],H={key:4},U={key:5,class:"mt-4 px-6 py-4 text-left"},G={class:"text-lg leading-relaxed font-sans text-gray-800"},J={key:0,class:"text-base leading-relaxed font-sans text-gray-400 mt-3 italic"},K="https://github.com/receptron/mulmocast-cli/blob/main/assets/images/mulmocast_credit.png?raw=true",N=e.defineComponent({__name:"mulmo_player",props:{index:{},videoWithAudioSource:{},soundEffectSource:{},videoSource:{},imageSource:{},audioSource:{},text:{},originalText:{},duration:{},defaultLang:{},currentLang:{},playbackSpeed:{default:1}},emits:["play","pause","ended"],setup(n,{expose:S,emit:P}){const o=n,m=P,c=e.ref(),t=e.ref(),l=e.ref(),i=e.ref(),h=e.ref(),p=()=>{t.value&&o.videoSource&&(o.audioSource&&o.currentLang&&o.defaultLang&&o.currentLang!==o.defaultLang?t.value.volume=.2:t.value.volume=0)},f=()=>{const d=o.playbackSpeed??1;c.value&&(c.value.playbackRate=d),t.value&&(t.value.playbackRate=d),l.value&&(l.value.playbackRate=d),i.value&&(i.value.playbackRate=d)};e.watch([()=>o.currentLang,()=>o.defaultLang,()=>o.videoSource,()=>o.audioSource],()=>{p()}),e.watch(()=>o.playbackSpeed,()=>{f()}),e.watch(t,d=>{d&&(p(),f())}),e.watch([c,l,i],()=>{f()}),e.onMounted(()=>{p(),f()});const T=()=>{s.value=!0,l.value&&t.value&&(l.value.currentTime=t.value.currentTime,l.value.currentTime===t.value.currentTime&&l.value.play()),m("play")},y=d=>{document.hidden||(s.value=!1),!t.value?.ended&&l?.value&&l.value?.pause(),console.log(d),b(d)},r=()=>{!l.value?.paused&&!l.value?.ended&&(l.value?.currentTime??0)>0||x()},V=()=>{!t.value?.paused&&!t.value?.ended&&(t.value?.currentTime??0)>0||x()},E=()=>{s.value=!0,m("play")},b=d=>{document.hidden||(s.value=!1);const a=d.target;a.duration!==a.currentTime&&m("pause")},x=()=>{s.value=!1,m("ended")},s=e.ref(!1);let g=null;const R=async()=>{s.value=!0,c.value&&(f(),c.value.play()),t.value&&(p(),f(),t.value.play(),l.value&&(l.value.currentTime=t.value.currentTime,l.value.play())),i.value&&(f(),i.value.play()),!c.value&&!t.value&&!i.value&&(await B((o.duration??0)*1e3),s.value=!1,m("ended"))},L=()=>{s.value&&(c.value?.paused&&c.value.play().catch(()=>{}),t.value?.paused&&t.value.play().catch(()=>{}),i.value?.paused&&i.value.play().catch(()=>{}),l.value?.paused&&l.value.play().catch(()=>{}))},_=()=>{document.hidden&&s.value?g||(g=setInterval(L,500)):document.hidden||g&&(clearInterval(g),g=null)},v=()=>{document.hidden&&s.value&&setTimeout(L,50)};return e.onMounted(()=>{document.addEventListener("visibilitychange",_),c.value?.addEventListener("pause",v),t.value?.addEventListener("pause",v),i.value?.addEventListener("pause",v),l.value?.addEventListener("pause",v)}),e.onUnmounted(()=>{document.removeEventListener("visibilitychange",_),c.value?.removeEventListener("pause",v),t.value?.removeEventListener("pause",v),i.value?.removeEventListener("pause",v),l.value?.removeEventListener("pause",v),g&&(clearInterval(g),g=null)}),S({play:R}),(d,a)=>(e.openBlock(),e.createElementBlock("div",$,[n.videoWithAudioSource?(e.openBlock(),e.createElementBlock("div",A,[e.createElementVNode("video",{ref_key:"videoWithAudioRef",ref:c,src:n.videoWithAudioSource,class:"mulmocast-video mx-auto h-auto max-h-[80vh] w-auto object-contain",controls:!0,playsinline:"true",onPlay:E,onPause:b,onEnded:x},null,40,j)])):n.soundEffectSource||n.videoSource?(e.openBlock(),e.createElementBlock("div",W,[e.createElementVNode("video",{ref_key:"videoRef",ref:t,class:"mulmocast-video mx-auto h-auto max-h-[80vh] w-auto object-contain",src:n.soundEffectSource||n.videoSource,controls:!0,playsinline:"true",onPlay:T,onPause:y,onEnded:r},null,40,M),n.audioSource?(e.openBlock(),e.createElementBlock("audio",{key:0,ref_key:"audioSyncRef",ref:l,src:n.audioSource,controls:!0,class:"hidden",onEnded:V},null,40,D)):e.createCommentVNode("",!0)])):n.audioSource?(e.openBlock(),e.createElementBlock("div",F,[n.imageSource?(e.openBlock(),e.createElementBlock("img",{key:0,src:n.imageSource,class:"mx-auto h-auto max-h-[80vh] w-auto object-contain",alt:"Background"},null,8,I)):(e.openBlock(),e.createElementBlock("img",{key:1,src:K,class:"mx-auto h-auto max-h-[80vh] w-auto object-contain",alt:"Background"})),e.createElementVNode("audio",{ref_key:"audioRef",ref:i,class:"mulmocast-audio absolute inset-0 w-full h-full",src:n.audioSource,controls:!0,onPlay:E,onPause:b,onEnded:x},null,40,z)])):n.imageSource?(e.openBlock(),e.createElementBlock("div",O,[e.createElementVNode("img",{ref_key:"imageRef",ref:h,src:n.imageSource,class:"max-w-full max-h-full object-contain"},null,8,q)])):(e.openBlock(),e.createElementBlock("div",H,"No media available")),n.text?(e.openBlock(),e.createElementBlock("div",U,[e.createElementVNode("p",G,e.toDisplayString(n.text),1),n.originalText&&n.originalText!==n.text?(e.openBlock(),e.createElementBlock("p",J,e.toDisplayString(n.originalText),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]))}}),Q=["value"],X=["value"],C=e.defineComponent({__name:"select_language",props:{modelValue:{}},emits:["update:modelValue"],setup(n,{emit:S}){const P=["en","ja"],o={en:"English",ja:"日本語"},m=S,c=t=>{const l=t.target;m("update:modelValue",l.value)};return(t,l)=>(e.openBlock(),e.createElementBlock("select",{value:n.modelValue,class:"px-4 py-2 bg-white border-2 border-gray-300 rounded-lg shadow-sm hover:border-indigo-400 focus:border-indigo-500 focus:ring-2 focus:ring-indigo-200 focus:outline-none transition-colors cursor-pointer text-base font-medium text-gray-700",onChange:c},[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(P,i=>e.createElementVNode("option",{key:i,value:i},e.toDisplayString(o[i]||i),9,X)),64))],40,Q))}}),Y={class:"w-full overflow-hidden"},Z={class:"max-w-7xl mx-auto px-4"},ee={class:"flex items-center justify-between"},ae=["disabled"],te={class:"px-4"},oe=["disabled"],ne=["src"],le=e.defineComponent({__name:"mulmo_viewer",props:{dataSet:{},basePath:{},initPage:{},audioLang:{default:"en"},textLang:{default:"en"},playbackSpeed:{default:1}},emits:["updatedPage","update:audioLang","update:textLang"],setup(n,{expose:S,emit:P}){const o=n,m=P,c=o.dataSet?.beats?.length??0,t=e.ref(o.initPage??0),l=e.ref(!0),i=e.ref(),h=e.ref(),p=e.computed({get:()=>o.audioLang,set:a=>m("update:audioLang",a||"en")}),f=e.computed({get:()=>o.textLang,set:a=>m("update:textLang",a||"en")});e.watch(()=>o.audioLang,async(a,u)=>{if(a!==u&&r.value){const w=r.value;r.value=!1,await B(500),w&&i.value&&(r.value=!0,await i.value.play())}}),e.watch(()=>o.textLang,async(a,u)=>{a!==u&&r.value&&(await B(100),i.value&&await i.value.play())});const T=e.computed(()=>o.dataSet?.beats[t.value]),y=a=>a?o.basePath+"/"+a:"",r=e.ref(!1),V=()=>{r.value=!0,h.value&&h.value.play()},E=()=>{console.log("pause"),r.value=!1,h.value&&h.value.pause()},b=async()=>{await B(500),i.value&&i.value.play()},x=a=>{t.value!==a&&(t.value=a,r.value&&l.value&&b())},s=a=>{const u=t.value+a;return u>-1&&u<c?(x(u),m("updatedPage",u),!0):!1},g=()=>{console.log("end"),l.value&&s(1)?b():(r.value=!1,h.value&&h.value.pause())},R={onPlay:V,onPause:E,onEnded:g},L=e.computed(()=>{const a=T.value,u=a?.audioSources?.[p.value],w=a?.multiLinguals?.[f.value]??a?.text??"",ie=o.dataSet?.lang?a?.multiLinguals?.[o.dataSet.lang]??a?.text??"":"";return{videoWithAudioSource:y(a?.videoWithAudioSource),videoSource:y(a?.videoSource),soundEffectSource:y(a?.soundEffectSource),audioSource:u?o.basePath+"/"+u:"",imageSource:y(a?.imageSource),index:t.value,text:w,originalText:ie,duration:a?.duration,defaultLang:o.dataSet?.lang,currentLang:p.value,playbackSpeed:o.playbackSpeed,...R}}),_=e.computed(()=>o.dataSet?.beats[t.value+1]),v=e.computed(()=>{if(t.value+1>=c)return null;const a=_.value;return{videoWithAudioSource:y(a?.videoWithAudioSource),videoSource:y(a?.videoSource),soundEffectSource:y(a?.soundEffectSource),audioSource:a?.audioSources?.[p.value]?o.basePath+"/"+a.audioSources[p.value]:"",imageSource:y(a?.imageSource),index:t.value+1,text:a?.multiLinguals?.[f.value]??a?.text??"",duration:a?.duration}}),d=e.computed(()=>({MulmoPlayer:N,pageProps:L.value,currentPage:t.value,pageCount:c,pageMove:s,isPlaying:r.value,audioLang:p,textLang:f,SelectLanguage:C,mediaPlayerRef:i,handlePlay:V,handlePause:E,handleEnded:g}));return S({updatePage:x}),(a,u)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.renderSlot(a.$slots,"default",e.normalizeProps(e.guardReactiveProps(d.value)),()=>[e.createElementVNode("div",Y,[e.createElementVNode("div",Z,[e.createElementVNode("div",ee,[e.createElementVNode("button",{class:"px-4 py-2 bg-gray-500 text-white rounded hover:bg-gray-600 disabled:opacity-50",disabled:t.value===0,onClick:u[0]||(u[0]=w=>s(-1))}," Prev ",8,ae),e.createElementVNode("div",te,[e.createVNode(N,e.mergeProps({ref_key:"mediaPlayer",ref:i},L.value),null,16)]),e.createElementVNode("button",{class:"px-4 py-2 bg-gray-500 text-white rounded hover:bg-gray-600 disabled:opacity-50",disabled:t.value>=e.unref(c)-1,onClick:u[1]||(u[1]=w=>s(1))}," Next ",8,oe)])])])]),v.value?e.withDirectives((e.openBlock(),e.createBlock(N,e.normalizeProps(e.mergeProps({key:0},v.value)),null,16)),[[e.vShow,!1]]):e.createCommentVNode("",!0),n.dataSet?.bgmFile?(e.openBlock(),e.createElementBlock("audio",{key:1,ref_key:"bgmRef",ref:h,src:n.dataSet?.bgmFile},null,8,ne)):e.createCommentVNode("",!0)],64))}});k.MulmoViewer=le,k.SelectLanguage=C,Object.defineProperty(k,Symbol.toStringTag,{value:"Module"})}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mulmocast-viewer",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "main": "dist/mulmocast-viewer.umd.js",
@@ -33,29 +33,27 @@
33
33
  },
34
34
  "repository": "git+ssh://git@github.com/receptron/mulmocast-viewer.git",
35
35
  "author": "receptron",
36
- "dependencies": {
37
- "vue": "^3.5.22",
38
- "vue-i18n": "^11.1.12",
39
- "vue-router": "^4.6.3"
40
- },
41
36
  "devDependencies": {
42
- "@eslint/js": "^9.38.0",
43
- "@tailwindcss/vite": "^4.1.15",
44
- "@types/node": "^24.9.1",
37
+ "@eslint/js": "^9.39.1",
38
+ "@tailwindcss/vite": "^4.1.17",
39
+ "@types/node": "^24.10.1",
45
40
  "@vitejs/plugin-vue": "^6.0.1",
46
41
  "@vue/tsconfig": "^0.8.1",
47
- "eslint": "^9.38.0",
42
+ "eslint": "^9.39.1",
48
43
  "eslint-config-prettier": "^10.1.8",
49
44
  "eslint-plugin-sonarjs": "^3.0.5",
50
45
  "eslint-plugin-vue": "^10.5.1",
51
- "globals": "^16.4.0",
46
+ "globals": "^16.5.0",
52
47
  "prettier": "^3.6.2",
53
- "tailwindcss": "^4.1.15",
48
+ "tailwindcss": "^4.1.17",
54
49
  "typescript": "~5.9.3",
55
- "typescript-eslint": "^8.46.2",
56
- "vite": "^7.1.11",
50
+ "typescript-eslint": "^8.47.0",
51
+ "vite": "^7.2.2",
57
52
  "vite-plugin-dts": "^4.5.4",
58
53
  "vue-eslint-parser": "^10.2.0",
59
- "vue-tsc": "^3.1.0"
54
+ "vue": "^3.5.24",
55
+ "vue-i18n": "^11.1.12",
56
+ "vue-router": "^4.6.3",
57
+ "vue-tsc": "^3.1.4"
60
58
  }
61
59
  }