I am developing a django project.Like udemy.Users can buy course but we are fetching course from youtube.If the user click the a tag the popup is opening and after click play video is playing on popup.We want to if video is finish do something.How can we do that?
course-detail.html
<div class="list_lessons">
<ul>
{% if session.getVideos %}
{% for video in session.getVideos %}
{% if video.video_type == "everybody" %}
<li ><a style="color: green; font-weight: bold;" href="{{video.url}}"
class="video">{{video.title}}</a><span></span></li>
{% else %}
{% if has_bougth == "true" %}
<li ><a style="color: green; font-weight: bold;" href="{{video.url}}"
class="video">{{video.title}}</a><span></span></li>
{% else %}
<li><a href="#" style="pointer-events: none; cursor: default;"
class="video"><i class="fa-solid fa-lock"></i> {{video.title}}</a><span></span></li>
{% endif %}
{% endif %}
{% endfor %}
{% endif %}
</ul>
</div>