Playsinline tag on video

How do I add a playsinline tag to a video element in cornerstone so that I can have a video autoplay on iOS safari, thanks.

Hello There,

Thanks for posting in! The video element does not allow you to insert any inline tag attribute. You may only do it by using a custom JS and inject the tag. Please do the following:

  • Click the video element and find the “Customize” tab
  • Insert a custom ID for example “my-video” in the ID field
  • And then you can insert this custom JS
(function($){
  $('#my-video').attr('controls');
  $('#my-video').trigger('play');
})(jQuery);

Please let us know if this works out for you.

This is what I was trying to avoid, but thank you for writing it for me! haha. Likely just going to create a new content area and write the player in html. I’ll test and update if this works out for the use case (auto-play video on iOS 11 Safari) as a workaround for webkit.

This does not work for autoplay on iOS 11.

Hi again,

Please try this one instead:

(function($){
  $('#my-video').attr('playsinline',''); 
})(jQuery);

Let us know how this goes!

New solution did not work either.

Hi,

Can you provide us the page url where we can see the video so we can take a closer look.

Thanks

Will add as secure note.

Hi there,

Please try:

(function($){
  $('#my-video video').attr('playsinline',''); 
})(jQuery);

This seems to have worked. I’ll report back after further testing.

Hi there,

Glad it works, cheers!

Thanks!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.