Streaming live at 10am (PST)

Javascript does not work

Hello! Can anyone tell me why this script isn’t working?
______ 1 ______ is a field from CMS, which outputs yes/no.
______ 2 ______ is a field from CMS, which outputs the URL to the source file.

I have also tried running the script without CMS by putting the values directly in the script. Didn’t work either.

<div id="anchorbox"></div>

function videoORaudio(){
    let v="______1______";
	let source = document.createElement('source');
	let audio = document.createElement("audio");"videoORaudio";
	let video = document.createElement("video");"videoORaudio"; = "480"; = "270";
	if (v === "no"){
	insertAfter(document.getElementById("anchorbox"), (audio));
  source.setAttribute('src', '______ 2 ______');
	insertAfter(document.getElementById("anchorbox"), (video));	
  source.setAttribute('src', ' ______ 2 ______');
	document.getElementById("videoORaudio").controls = true; 
function insertAfter(referenceNode, newNode) {
    referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling);

Thanks for the help!

I actually do not see your function invokation. At this time function videoORaudio is created but it sitting there waiting to be invoked. I do not know your code but you should create a event listener that will run your function as function itself do nothing it is just a few lines of code waiting to be used.