I'm doing a project with HTML and Javascript that will run local with local files. I need to select a file by input, get its information and then decide if I'll add to my list and reproduce or not. And if Ii decide to use it I'll have to put it on a queue to use later. Otherwise I'll just discard and select another file. The problem that I'm facing is that I can't find a way to get the video duration just by selecting it on input. I've searched a lot and I didn't find any method to get the duration. In this code below I tried to use 'file.duration' but it didn't work, it just returns 'undefined'. This is my input, normal as you can see.
And this is the function that I'm using to get all the information.
Is there way to do this? If not, what are the alternatives that can help me? 네이버 지식인 보고 만들어본 쥬크박스입니다. 위 URL 을 참조하시면 더 많은 기능을 첨부할수 있습니다. 소스는 다음과 같고 정렬된 소스는 같이 첨부합니다. <HTML> /** var addr = form.file.value; Player.URL = addr; // 노래 제목 삽입 // 변경된 프로그레스바 크기 지정 // 프로그레스바 초기화 // 음악 재생 // 볼륨조절 슬라이더 셋팅 // 반복 체크 값 true startTimeInterval(); // 재생시간 보기 /** /** nowTimeDiv.innerHTML = changeTimeType( nowTime ); percentage = Math.floor( ( nowTime / totalTime ) * 100 ); // 재생바 출력 stopMusic(); alert("재생 가능한 파일이 아닙니다."); clearInterval( id ); /** percentageDiv.innerHTML
= percentage + "%"; /** // 시간이 1분 초과했을 경우
if( time % 60 != 0 )
result += time % 60 + "초"; return result; /** /** /** /** /** /** /** /** // 볼륨 조절시 데이터 셋팅을 위한 이벤트 설정 setVolume( slider.getValue() ); // 볼륨 조절 <BODY onLOad =
"showSliderForVolume()"> - 2006.09.25일 webfx 에서 제공하는 슬라이더를 이용하여 볼륨조절 부분 추가 http://webfx.eae.net/dhtml/slider/slider.html 슬라이더 컴포넌트를 따로 추가하시려면 http://webfx.eae.net/download/slider102.zip 를 다운 |