0

Is there a reason SharePoint restricts some HTML 5 commands when embedded?

For example, when I embed this

<video width="320" height="240" controls>
  <source src="movie.mp4" type="video/mp4">
  <source src="movie.ogg" type="video/ogg">
  Your browser does not support the video tag.
</video>

SharePoint changes it to

<video width="320" height="240" controls="" unselectable="on">
  <source src="movie.mp4" type="video/mp4" unselectable="on">
  <source src="movie.ogg" type="video/ogg" unselectable="on">
  Your browser does not support the video tag.
</video>

Making it where I have to right click to play the video. Also, the "autoplay" function works while I am editing the embedded code, but as soon as I save the work, it takes autoplay out of my code.

I am hoping someone can point out a feature I have disabled to fix this. Thank you for any assistance you can give.

  • are you embedding it in a Content Editor WebPart? – Mike Jul 13 '15 at 21:52
1

I also observed this behavior while adding an HTML5 video to content editor webpart a month back. I don't know the reason as to why this is happening. But I found a workaround. Try changing your code to:

<video width="320" height="240" controls="controls" autoplay="autoplay">
  <source src="movie.mp4" type="video/mp4">
  <source src="movie.ogg" type="video/ogg">
  Your browser does not support the video tag.
</video>

Notice the use of controls="controls" autoplay="autoplay"

See this for more information: SharePoint 2013: HTML5 video

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.