tubearchivist/tubearchivist/home/templates/home/video.html

122 lines
6.4 KiB
HTML
Raw Normal View History

2021-09-05 17:10:14 +00:00
{% extends "home/base.html" %}
{% block content %}
{% load static %}
{% load humanize %}
<div class="video-main">
<video
src="/media/{{ video.media_url }}"
poster="/cache/{{ video.vid_thumb_url }}" controls preload="false"
Get Video Player Data Using New API (#151) * Get video player data using new API * Spelling * Removed extra data from play button * Reworked createPlayer, switched functions to API * Add theme to scrollbar * Removed extra metadata from playlist page * Removed extra metadat from channel page * Reworked createPlayer, switched functions to API * Update style.css * Changed watched indicator to match createVideo() * Fixed createPlayer() watched button * Fix watched indicator duplication * Minor clean up * Removed player-wrapper background * Added video/channel info to generated player * Removed description due to textReveal() conflict * Mark video as played at 90% playback * Groundwork for saving video playback * Add half and empty stars to getStarRating() * Check videoProgress input. * Added last refresh and date published * Switched date in create functions to API * Fomatted dates to match the old format * Remove console log from formatDates() * Cleaned up error on video player close * Added check for ryd dislikes/rating * Refined ryd check * Simplified player * Added player stats css formatting * Formatting for playlist name/link * Add playlist title/link to player * Commented out no longer used code * Fix missing end `"` on video-player class * Additional playlist error checking * Change setting video progress to html method * center thumbs icon, add eye icon for watched * add playerStats builder example, change some spacing * Removed `-` before playlist, reordered cast button * Minor cleanup of unused code. * Corrected POST data formating * consolidate video api calls into one * remove redundant api calls for search result population * do some jshint * shorten unit and add K to formatNumbers Co-authored-by: simon <simobilleter@gmail.com>
2022-02-05 11:26:31 +00:00
type='video/mp4' width="100%" playsinline id="video-item" ontimeupdate="onVideoProgress('{{ video.youtube_id }}')" onloadedmetadata="setVideoProgress(0)">
</video>
</div>
<div class="boxed-content">
<div class="title-bar">
{% if cast %}
<google-cast-launcher id="castbutton"></google-cast-launcher>
{% endif %}
<h1 id="video-title">{{ video.title }}</h1>
2021-09-05 17:10:14 +00:00
</div>
<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 %}
<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>
<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 %}
<img src="{% static 'img/icon-seen.svg' %}" alt="seen-icon" id="{{ video.youtube_id }}" onclick="isUnwatched(this.id)" class="seen-icon" title="Mark as unwatched">
{% else %}
<img src="{% static 'img/icon-unseen.svg' %}" alt="unseen-icon" id="{{ video.youtube_id }}" onclick="isWatched(this.id)" class="unseen-icon" title="Mark as watched.">
{% endif %}
2021-10-14 16:12:30 +00:00
</p>
{% 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 %}
<a download="" href="/media/{{ video.media_url }}"><button id="download-item">Download File</button></a>
<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>
<div class="info-box-item">
<div>
<p>Views: {{ video.stats.view_count|intcomma }}</p>
<p class="thumb-icon like"><img src="{% static 'img/icon-thumb.svg' %}" alt="thumbs-up">: {{ video.stats.like_count|intcomma }}</p>
{% if video.stats.dislike_count %}
<p class="thumb-icon dislike"><img src="{% static 'img/icon-thumb.svg' %}" alt="thumbs-down">: {{ video.stats.dislike_count|intcomma }}</p>
{% endif %}
{% if video.stats.average_rating %}
<p class="rating-stars">Rating:
{% for star in video.stats.average_rating %}
<img src="/static/img/icon-star-{{ star }}.svg" alt="{{ star }}">
{% endfor %}
</p>
{% endif %}
</div>
2021-09-05 17:10:14 +00:00
</div>
</div>
{% if video.description %}
<div class="info-box-item description-box">
<p>Description: <button onclick="textReveal()" id="text-reveal-button">Show</button></p>
<div id="text-reveal" class="description-text">
{{ video.description|linebreaks }}
</div>
</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>
<div class="playlist-nav">
<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 %}">
<img src="/cache/{{ playlist_item.playlist_previous.vid_thumb }}" alt="previous thumbnail">
2021-11-14 12:48:03 +00:00
</a>
<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 %}">
<img src="/cache/{{ playlist_item.playlist_next.vid_thumb }}" alt="previous thumbnail">
2021-11-14 12:48:03 +00:00
</a>
{% endif %}
</div>
2021-11-14 12:48:03 +00:00
</div>
</div>
{% endfor %}
{% endif %}
</div>
{% endblock content %}