2021-09-05 17:10:14 +00:00
{% extends "home/base.html" %}
{% block content %}
{% load static %}
{% load humanize %}
2022-11-21 08:31:54 +00:00
< div id = "player" class = "player-wrapper" >
< div class = "video-main" >
< div class = "video-modal" > < span class = "video-modal-text" > < / span > < / div >
< / div >
2022-10-24 13:11:00 +00:00
< / div >
2022-04-10 09:20:58 +00:00
< div class = "notifications" id = "notifications" > < / div >
< div class = "sponsorblock" id = "sponsorblock" >
2022-04-13 03:30:32 +00:00
{% if video.sponsorblock.is_enabled %}
{% if video.sponsorblock.segments|length == 0 %}
2022-04-10 09:20:58 +00:00
< h4 > This video doesn't have any sponsor segments added. To add a segment go to < u > < a href = "https://www.youtube.com/watch?v={{ video.youtube_id }}" > this video on YouTube< / a > < / u > and add a segment using the < u > < a href = "https://sponsor.ajay.app/" > SponsorBlock< / a > < / u > extension.< / h4 >
2022-04-13 03:30:32 +00:00
{% elif video.sponsorblock.has_unlocked %}
< h4 > This video has unlocked sponsor segments. Go to < u > < a href = "https://www.youtube.com/watch?v={{ video.youtube_id }}" > this video on YouTube< / a > < / u > and vote on the segments using the < u > < a href = "https://sponsor.ajay.app/" > SponsorBlock< / a > < / u > extension.< / h4 >
2022-04-10 09:20:58 +00:00
{% endif %}
{% endif %}
< / div >
2021-12-06 11:05:25 +00:00
< div class = "boxed-content" >
2021-12-08 07:30:13 +00:00
< div class = "title-bar" >
2022-01-11 11:31:22 +00:00
{% if cast %}
2022-01-15 06:33:16 +00:00
< google-cast-launcher id = "castbutton" > < / google-cast-launcher >
2022-01-11 11:31:22 +00:00
{% endif %}
2022-01-15 06:33:16 +00:00
< h1 id = "video-title" > {{ video.title }}< / h1 >
2021-09-05 17:10:14 +00:00
< / div >
2021-12-06 11:05:25 +00:00
< div class = "info-box info-box-3" >
< div class = "info-box-item" >
< div class = "round-img" >
< a href = "{% url 'channel_id' video.channel.channel_id %}" >
< img src = "/cache/channels/{{ video.channel.channel_id }}_thumb.jpg" alt = "channel-thumb" >
< / a >
< / div >
< div >
< h3 > < a href = "{% url 'channel_id' video.channel.channel_id %}" > {{ video.channel.channel_name }}< / a > < / h3 >
{% if video.channel.channel_subs >= 1000000 %}
< p > Subscribers: {{ video.channel.channel_subs|intword }}< / p >
2021-09-05 17:10:14 +00:00
{% else %}
2021-12-06 11:05:25 +00:00
< p > Subscribers: {{ video.channel.channel_subs|intcomma }}< / p >
2021-09-05 17:10:14 +00:00
{% endif %}
2021-10-09 10:11:13 +00:00
< / div >
2021-09-05 17:10:14 +00:00
< / div >
2021-12-06 11:05:25 +00:00
< div class = "info-box-item" >
< div >
< p > Published: {{ video.published }}< / p >
< p > Last refreshed: {{ video.vid_last_refresh }}< / p >
< p class = "video-info-watched" > Watched:
{% if video.player.watched %}
2022-03-10 13:20:23 +00:00
< img src = "{% static 'img/icon-seen.svg' %}" alt = "seen-icon" data-id = "{{ video.youtube_id }}" data-status = "watched" onclick = "updateVideoWatchStatus(this)" class = "watch-button" title = "Mark as unwatched" >
2021-12-06 11:05:25 +00:00
{% else %}
2022-03-10 13:20:23 +00:00
< img src = "{% static 'img/icon-unseen.svg' %}" alt = "unseen-icon" data-id = "{{ video.youtube_id }}" data-status = "unwatched" onclick = "updateVideoWatchStatus(this)" class = "watch-button" title = "Mark as watched" >
2021-12-06 11:05:25 +00:00
{% endif %}
2021-10-14 16:12:30 +00:00
< / p >
2021-12-06 11:05:25 +00:00
{% if video.active %}
< p > Youtube: < a href = "https://www.youtube.com/watch?v={{ video.youtube_id }}" target = "_blank" > Active< / a > < / p >
{% else %}
< p > Youtube: Deactivated< / p >
{% endif %}
2022-01-10 02:00:29 +00:00
< a download = "" href = "/media/{{ video.media_url }}" > < button id = "download-item" > Download File< / button > < / a >
2021-12-06 11:05:25 +00:00
< button onclick = "deleteConfirm()" id = "delete-item" > Delete Video< / button >
< div class = "delete-confirm" id = "delete-button" >
< span > Are you sure? < / span > < button class = "danger-button" onclick = "deleteVideo(this)" data-id = "{{ video.youtube_id }}" data-redirect = "{{ video.channel.channel_id }}" > Delete< / button > < button onclick = "cancelDelete()" > Cancel< / button >
< / div >
< / div >
2021-09-05 17:10:14 +00:00
< / div >
2021-12-06 11:05:25 +00:00
< div class = "info-box-item" >
< div >
2022-02-05 11:42:09 +00:00
< p class = "thumb-icon" > < img src = "{% static 'img/icon-eye.svg' %}" alt = "views" > : {{ video.stats.view_count|intcomma }}< / p >
2021-12-06 11:05:25 +00:00
< p class = "thumb-icon like" > < img src = "{% static 'img/icon-thumb.svg' %}" alt = "thumbs-up" > : {{ video.stats.like_count|intcomma }}< / p >
2021-12-15 10:39:52 +00:00
{% if video.stats.dislike_count %}
2022-02-05 11:42:09 +00:00
< p class = "thumb-icon" > < img class = "dislike" src = "{% static 'img/icon-thumb.svg' %}" alt = "thumbs-down" > : {{ video.stats.dislike_count|intcomma }}< / p >
2021-12-15 10:39:52 +00:00
{% endif %}
2021-12-06 11:05:25 +00:00
{% if video.stats.average_rating %}
2022-11-21 03:27:28 +00:00
< div class = "rating-stars" >
2021-12-06 11:05:25 +00:00
{% for star in video.stats.average_rating %}
< img src = "/static/img/icon-star-{{ star }}.svg" alt = "{{ star }}" >
{% endfor %}
2022-11-21 03:27:28 +00:00
< / div >
2021-12-06 11:05:25 +00:00
{% endif %}
< / div >
2021-09-05 17:10:14 +00:00
< / div >
< / div >
2022-11-21 03:27:28 +00:00
{% if video.tags %}
< div class = "description-box" >
< div class = "video-tag-box" >
{% for tag in video.tags %}
< span class = "video-tag" > {{ tag }}< / span >
{% endfor %}
< / div >
< / div >
{% endif %}
2021-12-06 11:05:25 +00:00
{% if video.description %}
2022-07-16 15:06:26 +00:00
< div class = "description-box" >
< p id = "text-expand" class = "description-text" >
{{ video.description|linebreaksbr|urlizetrunc:50 }}
< / p >
< button onclick = "textExpand()" id = "text-expand-button" > Show more< / button >
2021-12-06 11:05:25 +00:00
< / div >
{% endif %}
{% if playlist_nav %}
{% for playlist_item in playlist_nav %}
< div class = "playlist-wrap" >
< a href = "{% url 'playlist_id' playlist_item.playlist_meta.playlist_id %}" >
< h3 > Playlist [{{ playlist_item.playlist_meta.current_idx|add:"1" }}]: {{ playlist_item.playlist_meta.playlist_name }}< / h3 >
< / a >
2022-10-24 13:11:00 +00:00
< div class = "playlist-nav" >
2021-12-06 11:05:25 +00:00
< div class = "playlist-nav-item" >
{% if playlist_item.playlist_previous %}
2021-11-14 12:48:03 +00:00
< a href = "{% url 'video' playlist_item.playlist_previous.youtube_id %}" >
2021-12-06 11:05:25 +00:00
< img src = "/cache/{{ playlist_item.playlist_previous.vid_thumb }}" alt = "previous thumbnail" >
2021-11-14 12:48:03 +00:00
< / a >
2021-12-06 11:05:25 +00:00
< div class = "playlist-desc" >
< p > Previous:< / p >
< a href = "{% url 'video' playlist_item.playlist_previous.youtube_id %}" >
< h3 > [{{ playlist_item.playlist_previous.idx|add:"1" }}] {{ playlist_item.playlist_previous.title }}< / h3 >
< / a >
< / div >
{% endif %}
< / div >
< div class = "playlist-nav-item" >
{% if playlist_item.playlist_next %}
< div class = "playlist-desc" >
< p > Next:< / p >
< a href = "{% url 'video' playlist_item.playlist_next.youtube_id %}" >
< h3 > [{{ playlist_item.playlist_next.idx|add:"1" }}] {{ playlist_item.playlist_next.title }}< / h3 >
< / a >
< / div >
2021-11-14 12:48:03 +00:00
< a href = "{% url 'video' playlist_item.playlist_next.youtube_id %}" >
2021-12-06 11:05:25 +00:00
< img src = "/cache/{{ playlist_item.playlist_next.vid_thumb }}" alt = "previous thumbnail" >
2021-11-14 12:48:03 +00:00
< / a >
2021-12-06 11:05:25 +00:00
{% endif %}
< / div >
2021-11-14 12:48:03 +00:00
< / div >
2021-11-14 12:34:57 +00:00
< / div >
2021-12-06 11:05:25 +00:00
{% endfor %}
{% endif %}
2022-11-21 08:13:37 +00:00
< div class = "description-box" >
< h3 > Similar Videos< / h3 >
< div class = "video-list grid grid-3" id = "similar-videos" >
< / div >
< script > getSimilarVideos ( '{{ video.youtube_id }}' ) < / script >
< / div >
2022-11-18 02:44:20 +00:00
{% if video.comment_count %}
< div class = "comments-section" >
< h3 > Comments: {{video.comment_count}}< / h3 >
< div id = "comments-list" class = "comments-list" >
< / div >
2022-11-14 09:31:49 +00:00
< / div >
2022-11-18 02:44:20 +00:00
< script > getComments ( '{{ video.youtube_id }}' ) < / script >
{% endif %}
2021-12-06 11:05:25 +00:00
< / div >
2022-02-24 02:36:31 +00:00
< script >
2022-02-25 03:39:33 +00:00
var videoData = getVideoData('{{ video.youtube_id }}');
2022-04-10 09:20:58 +00:00
sponsorBlock = videoData.data.sponsorblock;
2022-07-21 10:15:36 +00:00
{% if position %}
var videoProgress = {{ position }}
{% else %}
var videoProgress = getVideoProgress('{{ video.youtube_id }}').position;
{% endif %}
2022-02-25 03:39:33 +00:00
window.onload = insertVideoTag(videoData, videoProgress);
2022-02-24 02:36:31 +00:00
< / script >
2022-01-10 02:00:29 +00:00
{% endblock content %}