Metadata-Version: 2.4
Name: wagtail-embedvideos
Version: 4.1.0
Summary: Embed Videos for Wagtail CMS
Author-email: "InfoPortugal, S.A." <suporte24@infoportugal.com>
Maintainer-email: Basil Shubin <basil.shubin@gmail.com>
License-Expression: BSD-3-Clause
Project-URL: download, https://github.com/bashu/wagtail-embedvideos/zipball/master
Project-URL: homepage, https://github.com/bashu/wagtail-embedvideos/
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Framework :: Django :: 3.2
Classifier: Framework :: Django :: 4.0
Classifier: Framework :: Wagtail
Classifier: Framework :: Wagtail :: 4
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.8
Description-Content-Type: text/x-rst
License-File: LICENSE
License-File: AUTHORS
Requires-Dist: django-embed-video>1.3
Requires-Dist: wagtail<4.2,>=4.1
Dynamic: license-file

wagtail-embedvideos
===================

.. image:: https://badge.fury.io/py/wagtail-embedvideos.svg
    :target: https://badge.fury.io/py/wagtail-embedvideos

.. image:: https://img.shields.io/pypi/pyversions/wagtail-embedvideos.svg
    :target: https://pypi.python.org/pypi/wagtail-embedvideos/

.. image:: https://img.shields.io/pypi/djversions/wagtail-embedvideos.svg
    :target: https://pypi.python.org/pypi/wagtail-embedvideos/

.. image:: https://github.com/bashu/wagtail-embedvideos/actions/workflows/test.yml/badge.svg
    :target: https://github.com/bashu/wagtail-embedvideos/actions/workflows/test.yml

Simple app that works similar to ``wagtailimages``, but for embedding YouTube and Vimeo videos and music from SoundCloud.

The current version is tested for compatiblily with the following:

- Wagtail version 4.x
- Django versions 3.2 to 4.0
- Python versions 3.8 to 3.10

Maintained by `Basil Shubin <https://github.com/bashu>`_,  and some great
`contributors <https://github.com/bashu/wagtail-embedvideos/contributors>`_.

.. image:: https://raw.githubusercontent.com/bashu/wagtail-embedvideos/develop/screenshot.png
   :target: https://raw.githubusercontent.com/bashu/wagtail-embedvideos/develop/screenshot.png
   :align: center
   :width: 600px

Installation
------------

First install the module, preferably in a virtual environment. It can be installed from PyPI:

.. code-block:: shell

    pip install wagtail-embedvideos

Requirements
~~~~~~~~~~~~

You must have *django-embed-video* installed and configured, see the
django-embed-video_ documentation for details and setup instructions.

Setup
-----

Make sure the project is configured for django-embed-video_.

Then add the following settings:

.. code-block:: python

    INSTALLED_APPS += (
        "wagtail_embed_videos",
    )

Then run ``./manage.py migrate`` to create the required database tables.

Usage
-----

In models, implement as a ``ForeignKey`` relation, same as ``wagtailimages``.

.. code-block:: python

    # models.py

    from wagtail.models import Page, PageBase

    from wagtail_embed_videos import get_embed_video_model_string
    from wagtail_embed_videos.edit_handlers import EmbedVideoChooserPanel

    class CustomPage(Page):
        video = models.ForeignKey(
            get_embed_video_model_string(),
            null=True, blank=True,
            on_delete=models.SET_NULL,
            related_name='+'
        )

        # ...

        content_panels = [
                EmbedVideoChooserPanel('video'),
        ]

In templates, load the ``embed_video_tags`` library in every template where you want to use it:

.. code-block:: html+django

    <!-- custom_page.html -->

    {% load embed_video_tags %}

    {% video self.video.url as my_video %}
        {% video my_video 'small' %}
    {% endvideo %}

Check django-embed-video_ documentation for more details.

Contributing
------------

If you like this module, forked it, or would like to improve it, please let us know!
Pull requests are welcome too. :-)

Credits
-------

`wagtail-embedvideos <https://github.com/bashu/wagtail-embedvideos/>`_ was originally started by `InfoPortugal, S.A. <https://github.com/infoportugal/>`_ who has now unfortunately abandoned the project.

License
-------

``wagtail-embedvideos`` is released under the BSD license.

.. _django-embed-video: https://github.com/jazzband/django-embed-video/

Changes
-------

4.1.0 (2026-09-04)
~~~~~~~~~~~~~~~~~~

* Wagtail version 4.1 supported. Dropped support for Wagtail < 4.1.
* Switched ``get_usage()`` to Wagtail 4.1's ``ReferenceIndex`` API
  (``wagtail.models.ReferenceIndex.get_references_to(self).group_by_source_object()``),
  replacing the old reflection-based ``get_object_usage()``. Existing
  installations must run ``./manage.py rebuild_references_index`` once
  after upgrading, to backfill usage data for content saved before the
  upgrade.
* The embed video "usage" view now checks "change" permission on the
  specific instance, and resolves proper edit URLs/labels for
  referencing objects via ``AdminURLFinder``; the usage template shows
  which field/content path each reference comes from.
* Added a usage count link to the embed video edit page, and removed
  the ``usage_count_enabled`` feature-flag guard around usage counts
  on the delete/bulk-delete confirmation templates (usage counting is
  now always available via ``ReferenceIndex``).
* Fixed ``get_valid_next_url_from_request`` import
  (``wagtail.admin.views.pages.utils`` moved to ``wagtail.admin.utils``
  in Wagtail 4.1).

4.0.0 (2026-09-04)
~~~~~~~~~~~~~~~~~~

* Wagtail version 4.x supported. Dropped support for Wagtail < 4.0.
* Rewrote the embed video chooser (widget, views and JS) on Wagtail 4.x's
  generic chooser framework (``wagtail.admin.views.generic.chooser``,
  ``wagtail.admin.viewsets.chooser.ChooserViewSet``,
  ``wagtail.admin.widgets.BaseChooser``), replacing the old
  ``AdminChooser``/``ModalWorkflow``-based implementation.
* Dropped the vendored ``tabs.js``: Wagtail 4.x exposes its own chooser-modal
  JS (``window.Chooser``, ``window.ChooserModalOnloadHandlerFactory``) as
  public globals for exactly this purpose, so it's no longer needed.
* Dropped support for Python 3.7 (no longer obtainable via ``uv``/
  ``python-build-standalone``; EOL since June 2023). Python versions
  3.8 to 3.10 supported.
* Excluded the ``tests`` package from the built wheel/sdist.

3.0.0 (2026-09-04)
~~~~~~~~~~~~~~~~~~

* Wagtail version 3.x supported. Dropped support for Wagtail < 3.0.
* Django versions 3.2 and 4.0 supported. Dropped support for Django < 3.2.
* Python versions 3.8 to 3.10 supported.
* Vendored Wagtail's own ``tabs.js`` into the embed video chooser modal, since
  Wagtail 3.x no longer exposes it as a public global, restoring full keyboard
  accessibility for the chooser's tabbed UI.
* Migrated packaging from ``setup.py``/``setup.cfg`` to ``pyproject.toml``.
* Switched CI from Travis to GitHub Actions.
* Fixed broken imports.

0.5.12 (2022-04-20)
~~~~~~~~~~~~~~~~~~~

* Fixed broken imports.

0.5.11 (2021-12-13)
~~~~~~~~~~~~~~~~~~~

* Added ru translation.

0.5.10 (2021-12-06)
~~~~~~~~~~~~~~~~~~~

* Fixed stupid typo.

0.5.9 (2021-12-06)
~~~~~~~~~~~~~~~~~~

* Wagtail version >= 2.15 supported.

0.5.8 (2021-11-12)
~~~~~~~~~~~~~~~~~~

* Wagtail version >= 2.14 supported.

0.5.7 (2021-11-11)
~~~~~~~~~~~~~~~~~~

* Wagtail version >= 2.13 supported.

0.5.6 (2021-11-10)
~~~~~~~~~~~~~~~~~~

* Wagtail version >= 2.12 supported.

0.5.5 (2021-11-09)
~~~~~~~~~~~~~~~~~~

* Wagtail version >= 2.11 supported.

0.5.4 (2021-11-08)
~~~~~~~~~~~~~~~~~~

* Wagtail version >= 2.10 supported.

0.5.3 (2021-11-07)
~~~~~~~~~~~~~~~~~~

* Replacing broken 0.5.2 release.

0.5.2 (2021-11-06)
~~~~~~~~~~~~~~~~~~

* Wagtail version >= 2.9 supported.

0.5.1 (2021-11-05)
~~~~~~~~~~~~~~~~~~

* Wagtail version >= 2.8 supported.

0.5.0 (2021-11-04)
~~~~~~~~~~~~~~~~~~

* Wagtail version >= 2.4 supported.
* Dropped support for Python < 3.x.

0.4.1 (2018-08-22)
~~~~~~~~~~~~~~~~~~

* Wagtail version >= 2.x supported.
* Django version >= 2.x supported.
* Dropped support for Wagtail < 2.x.

0.3.0 (2017-04-24)
~~~~~~~~~~~~~~~~~~

* Changed the structure of "AbstractEmbedVideo", because "TagSearchable" is not used anymore.

0.2.5 (2017-02-09)
~~~~~~~~~~~~~~~~~~

* This is the last version compatible with Wagtail <= 1.6, because TagSearchable was deprecated and then removed.
