HWDMediaShare has a feature which allows users with administrator privileges add media to the gallery using <embed> codes. This is very useful because it means you can add media from any website even if HWDMediaShare doesn't officially support it.

Youtube playlist embed code

Lets embed a Youtube playlist as an example. From the playlist page, copy the embed code.

 

Adding the embed code

From the Add Media page, select the Add Embed Code tool and enter the embed code which you just copied and finally click on the 'Add' button.

 

Viewing the media

The media will then be displayed in the frontend using the code you just entered.

 

Accepting different types of embed code

By default, HWDMediaShare will accept the following type of HTML tags when importing an embed code:

  • <embed>
  • <object>
  • <iframe>

Some websites have embed codes that use other embedding methods such as:

  • <script>

HWDMediaShare will not accept these tags because they present an increased security risk. If you are prepared to accept the increased risk you can modify HWDMediaShare to accept additional tags. To do this, edit the Embed library here:

/components/com_hwdmediashare/libraries/embed.php

The following line of code (line 77) includes the blacklisted tags. You can remove the tags which you want to accept from this line:

$safeHtmlFilter->tagBlacklist = array ('applet', 'body', 'bgsound', 'base', 'basefont', 'frame', 'frameset', 'head', 'html', 'id', 'ilayer', 'layer', 'link', 'meta', 'name', 'script', 'style', 'title', 'xml');

Login to view documentation

Sorry, the full article is visible to subscribers only.

Login   Subscribe