mirror of
https://github.com/arcodange-org/mediabunny.git
synced 2026-09-27 02:43:48 +02:00
Add media player example
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
<img src="../../assets/download-icon.svg" class="opacity-30 group-hover:opacity-80 dark:invert">
|
||||
</a>
|
||||
</div>
|
||||
<p class="text-xs opacity-60 mt-0.5" id="file-name"></p>
|
||||
<p class="text-xs opacity-60 mt-2" id="file-name"></p>
|
||||
|
||||
<hr class="w-96 my-4 border-gray-300 dark:border-zinc-700" style="display: none;">
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { Input, ALL_FORMATS, BlobSource, CanvasSink } from 'mediakit';
|
||||
|
||||
const selectMediaButton = document.querySelector('button')!;
|
||||
const fileNameElement = document.querySelector('#file-name')!;
|
||||
const horizontalRule = document.querySelector('hr')!;
|
||||
const thumbnailContainer = document.querySelector('#thumbnail-container')!;
|
||||
const errorElement = document.querySelector('#error-element')!;
|
||||
const selectMediaButton = document.querySelector('button') as HTMLButtonElement;
|
||||
const fileNameElement = document.querySelector('#file-name') as HTMLParagraphElement;
|
||||
const horizontalRule = document.querySelector('hr') as HTMLHRElement;
|
||||
const thumbnailContainer = document.querySelector('#thumbnail-container') as HTMLDivElement;
|
||||
const errorElement = document.querySelector('#error-element') as HTMLParagraphElement;
|
||||
|
||||
const THUMBNAIL_COUNT = 16;
|
||||
const THUMBNAIL_SIZE = 200;
|
||||
@@ -91,6 +91,8 @@ const generateThumbnails = async (file: File) => {
|
||||
}
|
||||
};
|
||||
|
||||
/** === FILE SELECTION LOGIC === */
|
||||
|
||||
selectMediaButton.addEventListener('click', () => {
|
||||
const fileInput = document.createElement('input');
|
||||
fileInput.type = 'file';
|
||||
|
||||
Reference in New Issue
Block a user