비디오 파일 blob으로 재생하기 ? 채택완료
https://sir.kr/g5_tip/9554?page=6" data-cturl="https://www.google.com/url?client=internal-element-cse&cx=005072632177869222749:u7ridrksc7m&q=https://sir.kr/g5_tip/9554%3Fpage%3D6&sa=U&ved=2ahUKEwifkbvX04vtAhVQA4gKHblgAOgQFjAAegQIABAC&usg=AOvVaw36_frJs8cjQSeFbL7OHz0U" dir="ltr" href="https://sir.kr/g5_tip/9554?page=6" target="_blank">비디오 파일 blob으로 재생하기 이런글이 있었는데
찾으려해도 없네요
비디오 파일을 blob 형태로해서 재생기키는 소스나 예제가 있는 공부할 자료좀 알려주세요
도움부탁드립니다 ㅠㅠ
댓글을 작성하려면 로그인이 필요합니다.
답변 2개
채택된 답변
+20 포인트
답변에 대한 댓글 7개
�
5년 전
보내주신 링크들어가서 소스대로 해보니 잘 작동됩니다.
사용자가 재생할 파일을 선택하는것이 아니라 서버안에 test.mp4 를 올려놓고 페이지에 접속하면
test.mp4 를 플레이 하도록 OnLoad 도 해보고 제가 아는 선에서 이거저거 해봤는데
프로그램을 전혀 몰라서인지 작동안하네요.
죄송하지만 서버안에 지정된 경로에 있는 파일을 재생하도록하는 소스좀 부탁드립니다.
아 댓글쓰기 이기능을 몰라서 피같은 100포인트를 쪽지보내기로 날렸네요 ㅠㅠ
사용자가 재생할 파일을 선택하는것이 아니라 서버안에 test.mp4 를 올려놓고 페이지에 접속하면
test.mp4 를 플레이 하도록 OnLoad 도 해보고 제가 아는 선에서 이거저거 해봤는데
프로그램을 전혀 몰라서인지 작동안하네요.
죄송하지만 서버안에 지정된 경로에 있는 파일을 재생하도록하는 소스좀 부탁드립니다.
아 댓글쓰기 이기능을 몰라서 피같은 100포인트를 쪽지보내기로 날렸네요 ㅠㅠ
�
5년 전
[code]
var req = new XMLHttpReqest();
xhr.open("GET", "test.mp4", true);
xhr.responseType = "blob";
xhr.onreadystatechange = function () {
if (xhr.readyState == xhr.DONE) {
var blob = xhr.reponse;
var video = URL.createObjectURL(blob);
}
}
xhr.send();
[/code]
var req = new XMLHttpReqest();
xhr.open("GET", "test.mp4", true);
xhr.responseType = "blob";
xhr.onreadystatechange = function () {
if (xhr.readyState == xhr.DONE) {
var blob = xhr.reponse;
var video = URL.createObjectURL(blob);
}
}
xhr.send();
[/code]
�
5년 전
[code]
var req = new XMLHttpReqest();
xhr.open("GET", "test.mp4, true);
xhr.responseType = "blob";
xhr.onreadystatechange = function () {
if (xhr.readyState == xhr.DONE) {
var blob = xhr.reponse;
var video = URL.createObjectURL(blob);
}
}
xhr.send();
[/code]
아 죄송한데 html 까지 한번에 부탁드릴게요.
기존 소스에서 스크립트 부분만 새거로 넣어보니 작동을 안해서
xhr.open("GET", "test.mp4, true); 여기에 "test.mp4" 일거같아서 수정도 해보고
var req 를 var xhr 로 바꿔보기도하고 이거저거 다해봤는데 ㅠㅠ
[code]
<body>
<input type="file" name="file" id="fileItem" onchange="onChange()" >
<input type="submit" value="Play">
<video></video>
<script type="text/javascript">
var xhr = new XMLHttpReqest();
xhr.responseType = 'blob';
xhr.onload = function() {
xhr.open("GET", "test.mp4", true);
xhr.responseType = "blob";
xhr.onreadystatechange = function () {
if (xhr.readyState == xhr.DONE) {
var blob = xhr.reponse;
var video = URL.createObjectURL(blob);
}
}
xhr.send();
}
</script>
</body>
[/code]
어디가 문제인지 ㅜㅜ
var req = new XMLHttpReqest();
xhr.open("GET", "test.mp4, true);
xhr.responseType = "blob";
xhr.onreadystatechange = function () {
if (xhr.readyState == xhr.DONE) {
var blob = xhr.reponse;
var video = URL.createObjectURL(blob);
}
}
xhr.send();
[/code]
아 죄송한데 html 까지 한번에 부탁드릴게요.
기존 소스에서 스크립트 부분만 새거로 넣어보니 작동을 안해서
xhr.open("GET", "test.mp4, true); 여기에 "test.mp4" 일거같아서 수정도 해보고
var req 를 var xhr 로 바꿔보기도하고 이거저거 다해봤는데 ㅠㅠ
[code]
<body>
<input type="file" name="file" id="fileItem" onchange="onChange()" >
<input type="submit" value="Play">
<video></video>
<script type="text/javascript">
var xhr = new XMLHttpReqest();
xhr.responseType = 'blob';
xhr.onload = function() {
xhr.open("GET", "test.mp4", true);
xhr.responseType = "blob";
xhr.onreadystatechange = function () {
if (xhr.readyState == xhr.DONE) {
var blob = xhr.reponse;
var video = URL.createObjectURL(blob);
}
}
xhr.send();
}
</script>
</body>
[/code]
어디가 문제인지 ㅜㅜ
�
5년 전
[code]
var xhr = new XMLHttpRequest();
xhr.open("GET", "test.mp4", true);
xhr.responseType = "blob";
xhr.onreadystatechange = function () {
if (xhr.readyState == xhr.DONE) {
var blob = xhr.reponse;
var video = URL.createObjectURL(blob);
}
}
xhr.send();
[/code]
오타랑 변수 선언이 실수가 있었네요
var xhr = new XMLHttpRequest();
xhr.open("GET", "test.mp4", true);
xhr.responseType = "blob";
xhr.onreadystatechange = function () {
if (xhr.readyState == xhr.DONE) {
var blob = xhr.reponse;
var video = URL.createObjectURL(blob);
}
}
xhr.send();
[/code]
오타랑 변수 선언이 실수가 있었네요
�
5년 전
[code]"<a class='gotoLine' href='#50:21'>50:21</a> Uncaught TypeError: Failed to execute 'createObjectURL' on 'URL': Overload resolution failed."[/code]
댓글을 작성하려면 로그인이 필요합니다.
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인전체 질문 목록
답변대기
채택
채택
답변대기
채택
답변대기
답변대기
채택
채택
답변대기
답변대기
채택
채택
답변대기
채택
답변대기
채택
답변대기
채택