Copy link to clipboard
Copied
how do I add the playsinline to the video tag in Animate?
many thanks in advanced
The following code seems to be the working solution;
$("#video")[0].setAttribute("playsinline", "");
Copy link to clipboard
Copied
what's the purpose? eg, are you trying to prevent fullscreen?
Copy link to clipboard
Copied
sorry yes, stop video going full screen on iphone with iOS 10
Copy link to clipboard
Copied
I'm assuming you're using the HTML5 video component. This might work:
document.getElementById("yourVideoComponentName").setAttribute("playsinline", "");
Place on the timeline at least one frame after the video component's first appearance.
Copy link to clipboard
Copied
The following code seems to be the working solution;
$("#video")[0].setAttribute("playsinline", "");
Copy link to clipboard
Copied
If you want to use jQuery for no reason, I suppose that would be a better solution than what I provided.
Copy link to clipboard
Copied
Sorry but I couldn't seem to get the document.getElementById() part of the code to work inside Animate, am i doing something wrong?
Copy link to clipboard
Copied
$("#whatever")[0] and document.getElementById("whatever") are functionally identical. Did you actually change the getElementById parameter to "video"?
javascript - document.getElementById vs jQuery $() - Stack Overflow