mirror of
https://github.com/Hopiu/django-embed-video.git
synced 2026-03-18 06:10:24 +00:00
Some video backends support optional arguments embedded in the URL query string that adjust how the video is displayed (e.g. Youtube supports rel=0 which means don't show related videos). Updated the template tag to accept optional KEY=VALUE pairs that will be added onto the embedded URL as a query string. Also added support for specifying default query strings on a per-backend basis (e.g. so that all YouTube urls have ?rel=0 added to the end). Added appropriate tests and documentation.
51 lines
1.2 KiB
ReStructuredText
51 lines
1.2 KiB
ReStructuredText
Settings
|
|
========
|
|
|
|
.. setting:: EMBED_VIDEO_BACKENDS
|
|
|
|
EMBED_VIDEO_BACKENDS
|
|
--------------------
|
|
|
|
List of backends to use.
|
|
|
|
Default::
|
|
|
|
EMBED_VIDEO_BACKENDS = (
|
|
'embed_video.backends.YoutubeBackend',
|
|
'embed_video.backends.VimeoBackend',
|
|
'embed_video.backends.SoundCloudBackend',
|
|
)
|
|
|
|
|
|
.. setting:: EMBED_VIDEO_TIMEOUT
|
|
|
|
EMBED_VIDEO_TIMEOUT
|
|
-------------------
|
|
|
|
Sets timeout for ``GET`` requests to remote servers.
|
|
|
|
Default: ``10``
|
|
|
|
|
|
.. setting:: EMBED_VIDEO_{BACKEND}_QUERY
|
|
|
|
EMBED_VIDEO_{BACKEND}_QUERY
|
|
---------------------------
|
|
|
|
Set default query dictionary for including in the embedded URL. This is
|
|
backend-specific. Substitute the actual name of the backend for {BACKEND}
|
|
(i.e. to set the default query for the YouTube backend, the setting name would
|
|
be ``EMBED_VIDEO_YOUTUBE_QUERY`` and for SoundCloud the name would be
|
|
``EMBED_VIDEO_SOUNDCLOUD_QUERY``).
|
|
|
|
As an example, if you set the following::
|
|
|
|
EMBED_VIDEO_YOUTUBE_QUERY = {
|
|
'wmode': 'opaque',
|
|
'rel': '0'
|
|
}
|
|
|
|
All URLs for YouTube will include the query string ``?wmode=opaque&rel=0``.
|
|
|
|
The default value for EMBED_VIDEO_YOUTUBE_QUERY is ``{'wmode': 'opaque'}``.
|
|
None of the other backends have default values set.
|