0

To anyone who can help, I'm at my wit's end and can't figure out how to play a tmp video file from my iphone. I'm using getUserMedia and I can save the file to my database and play it after upload. However, I'd like to preview a video before sending it to the database. Is that possible? The page flow would go like this: 1. Record a video, click a link and 2. show a new page with the tmp file playing in it. I reference the tmp file like this: $_FILES["media"]["tmp_name"]; (When I call the same file from the database I just add a .mov and it plays fine). Anyone have any ideas? Thanks ahead of time!

<!-------- HTML & VIDEO CAPTURE / page 1 -------->
<form action="play_video.php" method="post" enctype="multipart/form-data">
<input type="file" name="media" id="media" accept="video/*" capture="camcorder" style="display:none; width:0px; height:40px;padding:0px;">
<input type="submit" name="submit" id="submit" value="Submit"/>
</form>

<!-------- play_video.php / page 2 -------->
<script>
$(".play").click(function() {
var video_src = "<?php echo $_FILES["media"]["tmp_name"]; ?>";
var videoUrl = video_src + ".mp4";

$('#frag source').attr('src', videoUrl);
$('#frag')[0].load();
$('#frag')[0].play();
});
</script>

<body>
<video id="frag" autoplay controls>
<source src="" type="video/mp4">
</video>
<div class="play">play vid</div>
</body>
user791907
  • 61
  • 3

1 Answers1

0

I just read in an Apple iPhone forum that it's not possible to read a tmp file from the iphone's filesystem. Oh well, guess I'll just save the file to a tmp database.

Thanks anyway, all.

user791907
  • 61
  • 3