Embed macro
Displays embed content like videos from video platform and attachment and many other things from external services. |
Type | XAR |
Category | Other |
Developed by | Oana Tabaranu, Sergiu Dumitriu, Ludovic Dubost, Vincent Massol, Yann Flory, Mohamed Boussaa, Josué Tille |
Rating | |
License | GNU Lesser General Public License 2.1 |
Table of contents
- Description
- Usage
- Parameters definition
- Sample Code and Screenshots
- Get URL for each services
- Prerequisites & Installation Instructions
- Dependencies
Description
Displays embed content like videos from video platform and attachment and many other element from external services.
The Embed Macro displays videos from YouTube, Dailymotion, Vimeo and plays a video attached to your wiki page using Video.js library. mp4, webm and ogv formats are supported.
The Embed Macro can also play attached videos using Dynamic Adaptive Streaming over HTTP (DASH) technique.
You can create DASH videos in your wiki using the XWikiTube extension. Find more details here: XWikiTube application
Usage
Integrate content from external services (see Get URL for each services to see the list of supported services):
Play a video in an attachment:
Play a Dynamic Adaptive Streaming over HTTP video (DASH).
Parameters definition
Name | Value | Description |
---|---|---|
url | String | The URL to the content. See Get URL for each services for more details how to get the url for each integration. |
width | Number | The width of the embedded video, in pixel. The default value depends of the services to be integrated. |
height | Number | The height of the embedded video, in pixel. The default value depends of the services to be integrated. |
reference | String | The name of the entity to consider in case of an attachment video. See the Model module to understand the concept of references. Available since XWiki 3.4M1. |
attachment | String | The name of the video attachment. |
dash | String | The document in which the manifest.mpd file and the video streams are attached. |
videoPoster | String | The poster of the video is an image attachment that will be displayed before starting playing the video. |
ratio | String | Possible values: '1:1', '4:3', '16:9' and '21:9'. When this parameter is provided, the width and height are reset to 100% and the video is fit in the parent container. Available since version 1.13 of the macro. |
Sample Code and Screenshots
Youtube
{{embed url="http://www.youtube.com/watch?v=Titn-yAh74A" ratio="16:9"/}}
{{embed url="http://youtu.be/Titn-yAh74A" /}}
{{embed url="http://y2u.be/Titn-yAh74A" /}}
Dailymotion
Vimeo
Attachment
DASH
x.com
Single tweets
Profiles and lists
Google Docs, Sheets and Slides
Document
SpreadSheet
Presentation
Google Calendar
Google Maps
Place and address
Street view
Search result
video
{{embed url="https://fb.watch/u-umz3uyJB/"/}}
post
Figma
design
board
slide deck
Spotify
song
album
artist
playlist
Prezi
{{embed url="https://prezi.com/p/embed/SEuA3wOFhVxPmClZfY2Z/"/}}
Scribd
Flickr
Photo
Video
Album
Galery
Slideshare
{{embed url="https://www.slideshare.net/slideshow/embed_code/key/DeVayEMZSEP0gY?startSlide=1"/}}
Viddler
{{embed url="//viddler.com/embed/1391b468/?f=1&autoplay=0&player=full&secret=59822701&make_responsive=false&loop=false&nologo=false&disableseek=false&disablebackwardseek=false&disableforwardseek=false&hd=false"/}}
Get URL for each services
youtube
You can just copy the link from the URL of the browser.
dailymotion
You can just copy the link from the URL of the browser.
vimeo
On the video click on the "Share" button. And then copy the link from the share popup.
x.com
Single tweets
You can just copy the link from the URL of the browser.
Profiles and lists
You can just copy the link from the URL of the browser.
Google Docs, Sheets and Slides
Document
Click on "File" menu, then click on "share" > "Publish to web". On the popup click on "Publish" and copy the link from the "Link" tab.
SpredSheet
Click on "File" menu, then click on "share" > "Publish to web". On the popup click on "Publish" and copy the link from the "Link" tab.
Presentation
Click on "File" menu, then click on "share" > "Publish to web". On the popup select the settings of the presentation and click on "Publish" and copy the link from the "Link" tab.
Google Calendar
Open the calendar settings. On the left panel, select the calendar that you would like to show. On the main page, scoll down until the "Integrate calendar". Copy the link "Public URL to this calendar".
Google Maps
Place and address
On the left panel, click on the share button. Then, click on the "Embed a map" tab and retrive the url from the html code.
Street view
Click on the menu button (on the top left). On the left tab, click on "Share or embed map". Then, click on the "Embed a map" tab and retrive the url from the html code.
Search result
Click on the menu button (on the top left). On the left tab, click on "Share or embed map". Then, click on the "Embed a map" tab and retrive the url from the html code.
video
Open a video, click on share button. On the popup, click on "Copy link".
post
Open a specific post and just copy the link from the URL of the browser.
Click on the menu of a post you want to embed (on the corner top rignt of the post). Click on "Embed this post" and retrive the url from the html code.
Figma
For figma design, figma board or figma slide deck, you can just copy the link from the URL of the browser.
Spotify
song
Click on the menu of the song (3 dot on the right of the song) then on "Share" and on "Copy link to the song".
album
Click on the menu of the album then on "Share" and on "Copy link to the album".
artist
Click on the menu of the artist then on "Share" and on "Copy link to the artist".
playlist
Click on the menu of the playlist then on "Share" and on "Copy link to the playlist".
Prezi
On the project list page, click on the menu of a project (3 dot on buttom right of the project) and then click on "Share and confidentiality". On the popup, click on "Copy link".
Scribd
You can just copy the link from the URL of the browser.
Flickr
Photo
Open the image and then just copy the link from the URL of the browser.
Video
Open the video and then just copy the link from the URL of the browser.
Album
Open the album (page where you have the content list of the album) and then just copy the link from the URL of the browser.
Galery
Go on the galery section and then just copy the link from the URL of the browser.
Slideshare
You can just copy the link from the URL of the browser.
Viddler
You can just copy the link from the URL of the browser.
Prerequisites & Installation Instructions
We recommend using the Extension Manager to install this extension (Make sure that the text "Installable with the Extension Manager" is displayed at the top right location on this page to know if this extension can be installed with the Extension Manager). Note that installing Extensions when being offline is currently not supported and you'd need to use some complex manual method.
You can also use the following manual method, which is useful if this extension cannot be installed with the Extension Manager or if you're using an old version of XWiki that doesn't have the Extension Manager:
- Log in the wiki with a user having Administration rights
- Go to the Administration page and select the Import category
- Follow the on-screen instructions to upload the downloaded XAR
- Click on the uploaded XAR and follow the instructions
- You'll also need to install all dependent Extensions that are not already installed in your wiki
Dependencies
Dependencies for this extension (org.xwiki.contrib.embed:embed-macro-ui 1.0.1):
- org.xwiki.platform:xwiki-platform-rendering-macro-velocity 15.10.11
- org.xwiki.platform:xwiki-platform-rendering-macro-code 15.10.11
- org.xwiki.rendering:xwiki-rendering-macro-html 15.10.11
- org.xwiki.contrib.embed:video-js 1.0.1
- org.xwiki.contrib.embed:videojs-dash 1.0.1