2

I am trying to start playing a video from a specific location using Django:

<video controls autoplay id='vid' muted >
 <source src="{% static 'vids/videoplayback.mp4#t=10,30' %}" type="video/mp4">
</video>

This gives an error

GET http://127.0.0.1:8000/static/vids/videoplayback.mp4%23t%3D10%2C30 404 (Not Found)

as it seems Django automatically escaping the special characters is the culprit. Removing the #t=10,30 will autoplay the video without any issue.

How do I fix this?

1 Answer 1

2

You can set attrs as strings with the mustache-syntax e.g.: {{ 'random string' }}. Like this:

<video controls autoplay id='vid' muted >
 <source src="{% static 'vids/videoplayback.mp4' %}{{ '#t=10,30' }}" type="video/mp4">
</video>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.