Adding Video to Websites (embed.html)
embed.htmlis the same player that is used in the web interface of Flussonic Media Server.
The page with the player is available via the link:
The page automatically detects a browser version and selects a supported protocol. For the majority of devices it's HLS.
Important. Video playback might start without sound due to the autoplay policy of browser vendors. The following link explains the policy and conditions for the sound to turn on automatically. Chrome autoplay policy as an example
When opening embed.html directly (by entering the link in the address bar), the video will expand to the size of the browser window and start playback automatically.
Also, you can use
embed.html to insert video on a website as a part of a web page. The HTML code for insertion is available on the Overview page of each stream in the web interface.
<iframe style="width:640px; height:480px;" allowfullscreen src="http://hostname/streamname/embed.html"></iframe>
The code inserts a player window with a fixed dimension (640x480px) to the page. Playback starts automatically.
For most applications no additional configuration is required, but still
embed.html has parameters that can be specified via the URL. Additional parameters are set in the address bar:
- autoplay — autostart playback when the page is opened. The default value is true, to disable set false. Displays screenshots before viewing.
- play_duration — amount of seconds until video playback stops. The default is off. Useful for saving traffic.
- realtime — enables broadcasts via low latency protocols. Automatically selects between MSE-LD, RTMP or WebRTC. Is disabled by default, set true value for video playback with low latency. Attention! Low-latency broadcast consumes more CPU and network resources, do not use it without a real need, more details in a separate article.
- dvr — opens the archive player. To access the file, specify the value true. See DVR player below for details.
- ago — allows users to rewind back. The value is specified in seconds. The default is off. It's more convenient than DVR player for viewing video in the last few minutes or hours. Ideal for pausing and rewinding live video on the site. For example, the rewind hour is given by: embed.html?ago=3600.
- from — Unix timestamp of record start. If this option is specified the player will timeshift-abs of the playlist from the specified time.
- to — Unix timestamp of record end. Used only in conjunction with from. The player will open HLS VOD, rewind will be available within the specified interval.
An example of access to video from the archive. For example, recording a TV show:
Its better to generate such links via server side scripts, based on program guide (EPG) for the organization of a CatchUp service.
Archive player can be opened by the link:
The player can play the video from the archive, calendar is available for large archives in addition to timeline. The player interface allows you to set the timeline scale, enable fast playback and save the specified interval as an MP4 file.
All extra address line parameters are available to DVR player except ago.
The player interface allows you to automatically generate links in format embed.html?dvr=true&from=1511300552 without an additional tools. Just open a right time with timeline and click on the clock to open the link with from parameter.