Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
136 changes: 136 additions & 0 deletions website_media_video_html5/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

=========================
Website Media Video HTML5
=========================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:6e4083b96d07509d46bcb9d4f69b2de77a1b9af83abf95fb8e9037ff6657a31e
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fwebsite-lightgray.png?logo=github
:target: https://github.com/OCA/website/tree/19.0/website_media_video_html5
:alt: OCA/website
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/website-19-0/website-19-0-website_media_video_html5
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/website&target_branch=19.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module lets website editors embed video files hosted on their own
server or on a CDN, next to the YouTube, Vimeo, Dailymotion, Instagram
and Facebook videos supported by Odoo.

Such videos are played with the browser's native HTML5 ``<video>``
player, so no third-party player or cookies are involved. They can be
used:

- as a video block in a page, with the usual options (autoplay, loop,
hide player controls, start at);
- as a section background video, played muted and in a loop, covering
the whole section.

**Table of contents**

.. contents::
:local:

Configuration
=============

URLs ending with a video file extension (``.mp4``, ``.m4v``, ``.webm``,
``.ogv``, ``.ogg``) are accepted without configuration.

Many CDNs serve videos from URLs without a file extension. To allow
them, go to *Website > Configuration > Settings*, and list the hosts
serving these videos in *Self-hosted videos*, separated by commas (e.g.
``res.cloudinary.com``). Subdomains of these hosts are allowed as well.

Usage
=====

To add a video to a page:

1. Edit the page, and add a video block or replace a media (*Replace*
button of an image).
2. In the *Videos* tab, paste the URL of the video file, e.g.
``https://cdn.example.com/videos/product.mp4``.
3. Choose the player options and click *Add*.

To use a video as section background, select the section, enable the
*Video* background option and paste the URL of the video file the same
way.

As for other platforms, the player options are stored in the video URL;
they are removed from the URL the browser loads, so signed CDN URLs keep
working.

Known issues / Roadmap
======================

- Support HTTP Live Streaming (``.m3u8``) playlists, which need a
JavaScript player outside of Safari.
- Generate a poster image from the video.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/website/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/website/issues/new?body=module:%20website_media_video_html5%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* bosd

Contributors
------------

- Bosd

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

.. |maintainer-bosd| image:: https://github.com/bosd.png?size=40px
:target: https://github.com/bosd
:alt: bosd

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-bosd|

This module is part of the `OCA/website <https://github.com/OCA/website/tree/19.0/website_media_video_html5>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 2 additions & 0 deletions website_media_video_html5/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import controllers
from . import models
36 changes: 36 additions & 0 deletions website_media_video_html5/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Copyright 2026 Bosd
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Website Media Video HTML5",
"summary": "Embed self-hosted and CDN video files in website pages",
"version": "19.0.1.0.0",
"category": "Website",
"author": "bosd, Odoo Community Association (OCA)",
"maintainers": ["bosd"],
"website": "https://github.com/OCA/website",
"license": "AGPL-3",
"depends": ["website"],
"data": [
"views/res_config_settings_views.xml",
],
"assets": {
"html_editor.assets_media_dialog": [
"website_media_video_html5/static/src/js/html5_video_utils.esm.js",
"website_media_video_html5/static/src/editor/video_selector.esm.js",
"website_media_video_html5/static/src/editor/video_selector.xml",
],
"html_editor.assets_editor": [
"website_media_video_html5/static/src/editor/media_plugin.esm.js",
],
"web.assets_frontend": [
"website_media_video_html5/static/src/js/html5_video_utils.esm.js",
"website_media_video_html5/static/src/js/media_video.esm.js",
"website_media_video_html5/static/src/js/background_video.esm.js",
"website_media_video_html5/static/src/scss/html5_video.scss",
],
"web.assets_tests": [
"website_media_video_html5/static/tests/tours/**/*",
],
},
"installable": True,
}
1 change: 1 addition & 0 deletions website_media_video_html5/controllers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import main
47 changes: 47 additions & 0 deletions website_media_video_html5/controllers/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Copyright 2026 Bosd
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import http
from odoo.http import request

from odoo.addons.html_editor.controllers.main import HTML_Editor

from ..tools import get_allowed_hosts, get_html5_video_url_data


class HTML5VideoEditor(HTML_Editor):
@http.route()
def video_url_data(
self,
video_url,
autoplay=False,
loop=False,
hide_controls=False,
hide_fullscreen=False,
hide_dm_logo=False,
hide_dm_share=False,
start_from=False,
):
res = super().video_url_data(
video_url,
autoplay=autoplay,
loop=loop,
hide_controls=hide_controls,
hide_fullscreen=hide_fullscreen,
hide_dm_logo=hide_dm_logo,
hide_dm_share=hide_dm_share,
start_from=start_from,
)
if not res.get("error"):
return res
return (
get_html5_video_url_data(
video_url,
allowed_hosts=get_allowed_hosts(request.env),
autoplay=autoplay,
loop=loop,
hide_controls=hide_controls,
start_from=start_from,
)
or res
)
Loading
Loading