fawaz ali

fawaz ali

  • NA
  • 17
  • 829

problem with display video before upload

Feb 7 2018 6:27 AM
how are you
 
please help me to upload vedio and display it in iframe befor upload with java script in asp.net mvc
 
i con't to displied the video i work by asp.net mvc
 
please correct the example
 
this code in view
 
<div class="form-group">
<label class="control-label col-md-2">????? ???????</label>
<div class="col-md-10">
<input type="file" id="videoUpload" value="????? ??????" name="video" />
<iframe src="#" id="ShowVideo" width="560" height="315" frameborder="0"></iframe>
</div>
</div>
 
this code in section ajax
 
@section Scripts {
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript">
$(function () {
/* preview Vidio*/
function readUrl(input) {
if (input.files && input.files[0]) {
var reader = new FileReader();
reader.onload = function (e) {
$("iframe#ShowVideo")
.attr("src", e.target.result)
.width(200)
//.hight(200);
}
reader.readAsDataURL(input.files[0]);
}
}
$("#videoUpload").change(function () {
readUrl(this);
});
});

Answers (1)