I know this has been asked before but for some reason that strategy doesn’t seem to be working for me.
this is my code:
$(document).ready(function() {
$('#foo').click(function() {
var videoFile = 'video/law_cash.mp4';
$('#video_container video source').attr('src', videoFile);
});
});
the click function works and also when I check in firebug the video/law_cash.mp4 shows up in the right area. It just wont load when I click
EDIT: this is what im actually trying to do:
$(document).ready(function() {
var knicks = 'video/knicks_therapist.m4v';
law = 'video/law_cash.mp4';
fit = 'video/fit_some.mp4';
texas = 'video/texas_familia.mp4';
partner = 'video/drug.m4v';
keyspan = 'video/keyspan_nrg.mov';
$('#law').click(function() {
$('#video_container video source').attr('src', law);
$('#video_container video source').load();
});
$('#knicks').click(function() {
$('#video_container video source').attr('src', knicks);
$('#video_container video source').load();
});
$('#fit').click(function() {
$('#video_container video source').attr('src', fit);
$('#video_container video source').load();
});
$('#texas').click(function() {
$('#video_container video source').attr('src', texas);
$('#video_container video source').load();
});
$('#partner').click(function() {
$('#video_container video source').attr('src', partner);
$('#video_container video source').load();
});
$('#keyspan').click(function() {
$('#video_container video source').attr('src', keyspan);
$('#video_container video source').load();
});
});
html:
<a id="law" href="#">BLAH</a>
Firefox doesn’t support MPEG audio/video formats… dunno why.
EDIT: If you have an
onerrorevent registered then it would fire, and the video element’serrorobject will tell youMEDIA_ERR_SRC_NOT_SUPPORTED