비디오 파일 blob으로 재생하기 이런글이 있었는데
찾으려해도 없네요
비디오 파일을 blob 형태로해서 재생기키는 소스나 예제가 있는 공부할 자료좀 알려주세요
도움부탁드립니다 ㅠㅠ
|
답변 2개 / 댓글 7개
채택된 답변
+20 포인트
2020-11-18 (수) 18:35:09
답변에 대한 댓글 7개
2020-11-18 (수) 20:59:10
보내주신 링크들어가서 소스대로 해보니 잘 작동됩니다.
사용자가 재생할 파일을 선택하는것이 아니라 서버안에 test.mp4 를 올려놓고 페이지에 접속하면
test.mp4 를 플레이 하도록 OnLoad 도 해보고 제가 아는 선에서 이거저거 해봤는데
프로그램을 전혀 몰라서인지 작동안하네요.
죄송하지만 서버안에 지정된 경로에 있는 파일을 재생하도록하는 소스좀 부탁드립니다.
아 댓글쓰기 이기능을 몰라서 피같은 100포인트를 쪽지보내기로 날렸네요 ㅠㅠ
사용자가 재생할 파일을 선택하는것이 아니라 서버안에 test.mp4 를 올려놓고 페이지에 접속하면
test.mp4 를 플레이 하도록 OnLoad 도 해보고 제가 아는 선에서 이거저거 해봤는데
프로그램을 전혀 몰라서인지 작동안하네요.
죄송하지만 서버안에 지정된 경로에 있는 파일을 재생하도록하는 소스좀 부탁드립니다.
아 댓글쓰기 이기능을 몰라서 피같은 100포인트를 쪽지보내기로 날렸네요 ㅠㅠ
2020-11-18 (수) 21:13:10
[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]
2020-11-18 (수) 22:46:48
[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]
어디가 문제인지 ㅜㅜ
2020-11-18 (수) 23:28:46
[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]
오타랑 변수 선언이 실수가 있었네요
2020-11-18 (수) 23:44:28
[code]"<a class='gotoLine' href='#50:21'>50:21</a> Uncaught TypeError: Failed to execute 'createObjectURL' on 'URL': Overload resolution failed."[/code]
2020-11-18 (수) 23:45:25
플맹은 너무 힘드네요 오늘 이거만 10시간 가까이 봤는데 해결은 안되고 머리만 띵~~
2020-11-18 (수) 21:49:17
와 감사합니다
답변을 작성하려면 로그인이 필요합니다.