Trying change src on 2 html5 video element. And when I am trying to play both videos I get this eror:
Uncaught (in promise) DOMException: Failed to load because no supported source was found.
This is the code:
// First the video file is converted to base64 string with PHP and then send it though ajax
$array[$video_id] = 'data:video/mp4;base64,'.base64_encode(file_get_contents(get_template_directory().'/video/'.$video_id.'.mp4'));
var current = // base64 video string
// Current exercises
$('#video_run source').attr('src', current );
video_current = document.getElementById('video_run');
video_current.load();
video_current.play();
var next = // base64 video string
// Next exercises
$('#video_next source').attr('src', next );
video_next = document.getElementById('video_next');
video_next.load();
video_next.play();
An exemple on base64 string:
data:video/mp4;base64,[string]
Any idea what I am doing wrong?