I have this code:
<div class="video3">
<!--
<video src="{{ video.video.url }}" controls></video>
-->
{% if video.thumbnail %}
<img src="{{ video.thumbnail.url }}" alt="{{ video.title }}" style="width:100px;">
{% else %}
<span class="text-muted">Without thumbnail</span>
{% endif %}
<div class="top-left">{{ video.title }}</div>
</div>
{% endfor %}
</div>
I'd like to play the video {{ video.video.url }} in fullscreen when clicking the image (thumbnail) associated with the video.
I tried:
<a onclick="var video = document.createElement('video');
video.setAttribute('src', '{{ video.video.url }}');
video.load();
video.play();">
<img src="{{ video.thumbnail.url }}" alt="{{ video.title }}" style="width:100px;">
</a>
but I hear only the audio.
I already noticed the html poster attribute which is sufficient for my needs, but I'm interested if there is another solution, so I will leave the question open yet.