I need to run a video file for this iam using video element. The anomaly which iam seeing right now is that if iam setting the src programmatically then the file is not playing. While the same path if iam directly giving in src then the video is playing.
The Video resides in Videos folder of solution, so i dont think there is any access issues.
Below code directly assigns the src for video - Playing the file.
function ShowModalPopup() {
//$find("mpe").show();
//return false;
var param1 = new Date();
var month = param1.getMonth() + 1;
var day = param1.getDate();
var param2 = (('' + day).length < 2 ? '0' : '') + day + '/' + (('' + month).length < 2 ? '0' : '') + month + '/' + param1.getFullYear() + ' ' + param1.getHours() + ':' + param1.getMinutes() + ':' + param1.getSeconds();
$("#<%= hdnStartDateTime.ClientID %>").val(param2);
var url = $get("<%=lnkVideoLink.ClientID %>").value;
alert(url);
//$get("video").src = url;
$('[id*="MyVdo"]').attr('src', '../../MS_RIT_Training_Videos/REITIworkatTest.mp4');//type='video/mp4'
//$('[id*="MyVdo"]')[0].play();
$find("mpe").show();
return false;
}
Below code programmatically assigning src - Not Playing the video
function ShowModalPopup() {
//$find("mpe").show();
//return false;
var param1 = new Date();
var month = param1.getMonth() + 1;
var day = param1.getDate();
var param2 = (('' + day).length < 2 ? '0' : '') + day + '/' + (('' + month).length < 2 ? '0' : '') + month + '/' + param1.getFullYear() + ' ' + param1.getHours() + ':' + param1.getMinutes() + ':' + param1.getSeconds();
$("#<%= hdnStartDateTime.ClientID %>").val(param2);
var url = $get("<%=lnkVideoLink.ClientID %>").value;
alert(url);
//$get("video").src = url;
// $('[id*="MyVdo"]').attr('src', '../../MS_RIT_Training_Videos/REITIworkatTest.mp4');//type='video/mp4'
$('[id*="MyVdo"]').attr('src', url);//type='video/mp4'
//$('[id*="MyVdo"]')[0].play();
$find("mpe").show();
return false;
}
For Kenneth :
Alert:


urlagain. I'm actually pretty sure the problem is in there, if the first function runs without any problem.