Hi I have some very basic html for a video:
You can use:
$("#video_player")[0].play();
Or:
$("#video_player")[0].autoplay = true;
Or:
document.getElementById("video_player").setAttribute('autoplay', true);
Whatever suits you. Using $('#video_player').play(); you are referencing to non-existing method play in jQuery and you should reference to the object found by $("#video_player").
To change the src of the video in JS, you just simply need something like that:
function playFile() {
var video = $("#video_player");
video[0].src = "http://www.yoursrc.com/video_new.mp4";
video[0].load();
video[0].play();
};
muted property if you want to use the autoplay attribute. Refer to : https://developers.google.com/web/updates/2017/09/autoplay-policy-changes