mirror of
https://github.com/arcodange-org/mediabunny.git
synced 2026-09-28 03:13:51 +02:00
Modify examples to only accept video and audio files
This commit is contained in:
@@ -113,6 +113,7 @@ const compressFile = async (file: File) => {
|
|||||||
selectMediaButton.addEventListener('click', () => {
|
selectMediaButton.addEventListener('click', () => {
|
||||||
const fileInput = document.createElement('input');
|
const fileInput = document.createElement('input');
|
||||||
fileInput.type = 'file';
|
fileInput.type = 'file';
|
||||||
|
fileInput.accept = 'video/*,video/x-matroska,audio/*';
|
||||||
fileInput.addEventListener('change', () => {
|
fileInput.addEventListener('change', () => {
|
||||||
const file = fileInput.files?.[0];
|
const file = fileInput.files?.[0];
|
||||||
if (!file) {
|
if (!file) {
|
||||||
|
|||||||
@@ -544,6 +544,7 @@ const formatSeconds = (seconds: number) => {
|
|||||||
selectMediaButton.addEventListener('click', () => {
|
selectMediaButton.addEventListener('click', () => {
|
||||||
const fileInput = document.createElement('input');
|
const fileInput = document.createElement('input');
|
||||||
fileInput.type = 'file';
|
fileInput.type = 'file';
|
||||||
|
fileInput.accept = 'video/*,video/x-matroska,audio/*';
|
||||||
fileInput.addEventListener('change', () => {
|
fileInput.addEventListener('change', () => {
|
||||||
const file = fileInput.files?.[0];
|
const file = fileInput.files?.[0];
|
||||||
if (!file) {
|
if (!file) {
|
||||||
|
|||||||
@@ -155,6 +155,7 @@ const shortDelay = () => {
|
|||||||
selectMediaButton.addEventListener('click', () => {
|
selectMediaButton.addEventListener('click', () => {
|
||||||
const fileInput = document.createElement('input');
|
const fileInput = document.createElement('input');
|
||||||
fileInput.type = 'file';
|
fileInput.type = 'file';
|
||||||
|
fileInput.accept = 'video/*,video/x-matroska,audio/*';
|
||||||
fileInput.addEventListener('change', () => {
|
fileInput.addEventListener('change', () => {
|
||||||
const file = fileInput.files?.[0];
|
const file = fileInput.files?.[0];
|
||||||
if (!file) {
|
if (!file) {
|
||||||
|
|||||||
@@ -99,6 +99,7 @@ const generateThumbnails = async (file: File) => {
|
|||||||
selectMediaButton.addEventListener('click', () => {
|
selectMediaButton.addEventListener('click', () => {
|
||||||
const fileInput = document.createElement('input');
|
const fileInput = document.createElement('input');
|
||||||
fileInput.type = 'file';
|
fileInput.type = 'file';
|
||||||
|
fileInput.accept = 'video/*,video/x-matroska,audio/*';
|
||||||
fileInput.addEventListener('change', () => {
|
fileInput.addEventListener('change', () => {
|
||||||
const file = fileInput.files?.[0];
|
const file = fileInput.files?.[0];
|
||||||
if (!file) {
|
if (!file) {
|
||||||
|
|||||||
Reference in New Issue
Block a user