Start a new topic

Embedding videos on Topics and Packages...

It refers to whose is having issues trying to embed a video on a Multistore topic using the Admin.


Recently I had a problem trying to embed a video on my home page (HomePage.HomeImage) because it didn't start to play automatically. Reviewing the HTML5 documentation I figured that I had to add the property "autoplay" this way:


<video>

<source src="(!SkinPath!)/images/myvideo.mp4" type="video/mp4" autoplay></source>

</video>


However I noticed that after to click the "Save" button the Admin automatically trimmed (deleted) the autoplay off. After several attempts I figured that although it was the correct syntax it seems that Multistore system doesn't like it, and instead you have to do:


<video>

<source src="(!SkinPath!)/images/myvideo.mp4" type="video/mp4" autoplay="yes"></source>

</video>


It will do the trick. Actually it serves also for XML packages, because every time you use a property without a value it will break your package at run time.


For instances, second the HTML5 documentation to enable the video controls (play, pause, etc) to your video you should add the property "controls" like this:


<video>

<source src="(!SkinPath!)/images/myvideo.mp4" type="video/mp4" controls></source>

</video>


But again if you do this inside Admin your "controls" property will just vanish after you save your topic and if you try this into a XML package it will crash the site when you run the package. Then, as previously, the solution is to add a value to the property:


<video>

<source src="(!SkinPath!)/images/myvideo.mp4" type="video/mp4" controls="yes"></source>

</video>


So to use both properties (autoplay and controls) you would do:


<video>

<source src="(!SkinPath!)/images/myvideo.mp4" type="video/mp4" autoplay="yes" controls="yes"></source>

</video>


So remember that when using such kind of property in Multistore always give a value to it. In this case the best solution is ="yes".


Enjoy!

Login or Signup to post a comment