Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support online video services as well #12

Open
choldgraf opened this issue Feb 20, 2023 · 4 comments
Open

Support online video services as well #12

choldgraf opened this issue Feb 20, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@choldgraf
Copy link
Collaborator

In many cases, video content might be hosted online in a service instead of locally.
For example, many people upload videos to Google Drive or YouTube, and then want to embed their videos in documentation.

I think that it'd be in-scope for this extension to support these use-cases as well, for a limited subset of common video services. Probably somewhere around here:

class Video(Directive):

Implementing the logic to support a service would be too much work. For example, you could just add an extra check for whether the argument to .. video:: starts with http, and if so, try to detect the service (e.g., "youtube.com" self.arguments[0] or self.options.get("kind") == "youtube"). Then you could output an HTML raw:: block that included the proper structure for that video type.

If you want to see one example of directive logic like this, see:

https://github.com/2i2c-org/sphinx-2i2c-theme/blob/update-theme/src/sphinx_2i2c_theme/video.py

@choldgraf choldgraf added the enhancement New feature or request label Feb 20, 2023
@12rambau
Copy link
Member

for this very purpose there is the https://github.com/sphinx-contrib/youtube extention that works for vimeo and youtube is it fiting your objectives ?

@choldgraf
Copy link
Collaborator Author

choldgraf commented Feb 20, 2023

I suppose so, though it seems excessive to have to install a separate extension + have a different directive for each type of thing given how simple the logic is. Also confusing that it is called youtube but also supports non-youtube services like vimeo. But strictly speaking that does satisfy the use-case :-)

@12rambau
Copy link
Member

in the background, that's in fact quite different as vimeo and youtube provide specific iframes with specific parameters + that allows people to only specify the video ID (I use it a lot as everything I do is stored on youtube).

@choldgraf
Copy link
Collaborator Author

For sure - that's my point. Users shouldn't have to care about whether it's "a youtube video or a vimeo video", they should just (IMO) have a single directive where they can post the URL of many video services, and the directive can figure out the logic for them. The directive logic is pretty simple, but anything that can reduce the number of things a user has to remember or think about is a good idea I think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants