video.html 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="referrer" content="never">
  6. <meta name="viewport" content="width=device-width, initial-scale=1">
  7. <title>{{ vidinfo['title'] }} - MikuInvidious</title>
  8. <link rel="stylesheet" href="/static/css/video.css">
  9. <!-- MDUI CSS -->
  10. <link
  11. rel="stylesheet"
  12. href="https://cdn.jsdelivr.net/npm/mdui@1.0.1/dist/css/mdui.min.css"
  13. integrity="sha384-cLRrMq39HOZdvE0j6yBojO4+1PrHfB7a9l5qLcmRm/fiWXYY+CndJPmyu5FV/9Tw"
  14. crossorigin="anonymous"
  15. />
  16. <!-- MDUI JavaScript -->
  17. <script
  18. src="https://cdn.jsdelivr.net/npm/mdui@1.0.1/dist/js/mdui.min.js"
  19. integrity="sha384-gCMZcshYKOGRX9r6wbDrvF+TcCCswSHFucUzUPwka+Gr+uHgjlYvkABr95TCOz3A"
  20. crossorigin="anonymous"
  21. ></script>
  22. <script>window.srcinfo = {};</script>
  23. {% for fmt in srcinfo['support_formats'] %}
  24. <script type="application/javascript"
  25. src="{{ url_for('video_view_info', vid = vidinfo['bvid'], cid = cid, qn = fmt['quality']) }}"
  26. ></script>
  27. {% endfor %}
  28. </head>
  29. <body class="mdui-theme-primary-pink mdui-theme-layout-dark">
  30. {% include 'toolbar.html' %}
  31. <div class="mdui-container mdui-typo">
  32. <div class="mdui-row" style="display: flex; align-items: stretch;">
  33. <!-- Video -->
  34. {% if vidinfo['videos'] > 1 %}
  35. <div class="mdui-col-sm-9">
  36. {% endif %}
  37. <video id="video-player" class="mdui-center" width="640" height="360" controls poster="{{ vidinfo['pic'] }}">
  38. <source id="video-source" src="/proxy/vid/{{ srcinfo['durl'][0]['url'] }}" type="video/mp4">
  39. <p>要观看本视频,您需要先启用 JavaScript 并考虑更新到一个 <a href="https://videojs.com/html5-video-support/" target="_blank">支持 html5 视频的浏览器</a>。</p>
  40. </video>
  41. {% if vidinfo['videos'] > 1 %}
  42. </div>
  43. {% endif %}
  44. <!-- Playlist -->
  45. {% if vidinfo['videos'] > 1 %}
  46. <div class="mdui-col-sm-3 subvid-col mdui-shadow-8">
  47. <ul class="mdui-list clearlr-padding">
  48. {% for subvid in subvids %}
  49. {% if subvid['cid'] == cid|int %}
  50. <li class="mdui-list-item mdui-color-theme">{{ subvid['page'] }}. {{ subvid['part'] }}</li>
  51. {% else %}
  52. <li class="mdui-list-item mdui-ripple">
  53. <a href="/video/{{ vidinfo['bvid'] }}:{{ subvid['cid'] }}">{{ subvid['page'] }}. {{ subvid['part'] }}</a>
  54. </li>
  55. {% endif %}
  56. {% endfor %}
  57. </ul>
  58. </div>
  59. {% endif %}
  60. </div>
  61. <h1>{{ vidinfo['title'] }} <small><code>{{ vidinfo['bvid'] }}</code></small></h1>
  62. <div class="mdui-row">
  63. <div class="mdui-col-sm-2">
  64. <div class="mdui-typo-subheading">
  65. <!-- Actions -->
  66. <a href="https://bilibili.com/video/{{ vidinfo['bvid'] }}/">在哔哩哔哩观看</a>
  67. <br/>
  68. <a href="/switch">切换 MikuInvidious 实例</a>
  69. <br/>
  70. <a href="/embed/{{ vidinfo['bvid'] }}">嵌入式播放器</a>
  71. <br/>
  72. <div class="js-only mdui-hidden">
  73. <button class="mdui-btn mdui-color-theme" mdui-menu="{target: '#qnselector'}">切换画质</button>
  74. <ul class="mdui-menu" id="qnselector">
  75. {% for fmt in srcinfo['support_formats'] %}
  76. <li class="mdui-menu-item"><a href="javascript:switch_qn({{ fmt['quality'] }});">{{ fmt['new_description'] }}</a></li>
  77. {% endfor %}
  78. </ul>
  79. </div>
  80. <div class="nojs-only">
  81. <form>
  82. <label for="qn">可用画质:</label>
  83. <select name="qn" class="mdui-btn">
  84. {% for fmt in srcinfo['support_formats'] %}
  85. {% if srcinfo['quality'] != fmt['quality'] %}
  86. <option value="{{ fmt['quality'] }}">{{ fmt['new_description'] }}</option>
  87. {% else %}
  88. <option selected value="{{ fmt['quality'] }}">{{ fmt['new_description'] }}</option>
  89. {% endif %}
  90. {% endfor %}
  91. </select>
  92. <input class="mdui-btn mdui-color-theme" type="submit" value="更换画质">
  93. </form>
  94. </div>
  95. <br/>
  96. <!-- Infomation -->
  97. <i class="mdui-icon material-icons">&#xe8dc;</i> {{ vidinfo['stat']['like'] }} <br/>
  98. <i class="mdui-icon material-icons">&#xe885;</i> {{ vidinfo['stat']['favorite'] }} <br/>
  99. <i class="mdui-icon material-icons">&#xe263;</i> {{ vidinfo['stat']['coin'] }} <br/>
  100. <i class="mdui-icon material-icons">&#xe80d;</i> {{ vidinfo['stat']['coin'] }} <br/>
  101. </div>
  102. </div>
  103. <div class="mdui-col-sm-7">
  104. <div class="mdui-row">
  105. <a href="/space/{{ vidinfo['owner']['mid'] }}">
  106. <div class="mdui-chip">
  107. <img class="mdui-chip-icon" src="{{ vidinfo['owner']['face']|picproxy }}"/>
  108. <span class="mdui-chip-title">
  109. {{ vidinfo['owner']['name'] }}
  110. <code>{{ vidinfo['owner']['mid'] }}</code>
  111. </span>
  112. </div>
  113. </a>
  114. <div class="mdui-chip">
  115. <span class="mdui-chip-icon mdui-color-theme">
  116. <i class="mdui-icon material-icons">high_quality</i>
  117. </span>
  118. <span class="mdui-chip-title" id="quality-text">
  119. {% for fmt in srcinfo['support_formats'] %}
  120. {% if srcinfo['quality'] == fmt['quality'] %}
  121. {{ fmt['new_description'] }}
  122. {% endif %}
  123. {% endfor %}
  124. </span>
  125. </div>
  126. <div id="subform">
  127. <form>
  128. <button class="mdui-btn mdui-btn-raised" style="margin-right: 2em;" disabled>关注</button>
  129. </form>
  130. </div>
  131. </div>
  132. <h6>投稿于 {{ vidinfo['pubdate']|date }}</h6>
  133. <p class="normalspace">{{ vidinfo['desc'] }}</p>
  134. <div class="mdui-panel" mdui-panel>
  135. <div class="mdui-panel-item mdui-panel-item-open">
  136. <div class="mdui-panel-item-header">查看总共 {{ vidinfo['stat']['reply'] }} 条评论</div>
  137. <div class="mdui-panel-item-body clearlr-padding">
  138. <ul class="mdui-list clearlr-padding">
  139. {% for comm in comments['replies'] %}
  140. {% if not comm['root'] %}
  141. <li class="mdui-list-item clearlr-padding">
  142. <div class="mdui-card mdui-hoverable" style="width: 100%">
  143. <div class="mdui-card-header">
  144. <img class="mdui-card-header-avatar" src="{{ comm['member']['avatar']|picproxy }}"/>
  145. <div class="mdui-card-header-title">
  146. <a href="/space/{{ comm['member']['mid'] }}">{{ comm['member']['uname'] }}</a>
  147. </div>
  148. <div class="mdui-card-header-subtitle">
  149. {% set level = comm['member']['level_info']['current_level'] %}
  150. {% include 'level.html' %}
  151. {% if comm['member']['fans_detail'] %}
  152. {% set level = comm['member']['fans_detail']['level'] %}
  153. {% set medal_name = comm['member']['fans_detail']['medal_name'] %}
  154. {% include 'fans.html' %}
  155. {% endif %}
  156. </div>
  157. </div>
  158. <div class="mdui-card-content normalspace">{{ comm['content']['message']|safe }}</div>
  159. </div>
  160. </li>
  161. {% endif %}
  162. {% endfor %}
  163. </ul>
  164. </div>
  165. </div>
  166. </div>
  167. </div>
  168. <div class="mdui-col-sm-3">
  169. <div class="mdui-row-xl-2 mdui-row-lg-1">
  170. <div class="js-only mdui-hidden">
  171. <label class="mdui-switch">
  172. 自动连播:
  173. <input type="checkbox" id='autonext-check' onclick="localStorage.setItem('autonext', this.checked ? 'yes' : 'no');"/>
  174. <i class="mdui-switch-icon"></i>
  175. </label>
  176. </div>
  177. <div class="mdui-divider"></div>
  178. {% for vid in relatedvids %}
  179. <div class="mdui-col">
  180. <div class="mdui-card relatedvid">
  181. <div class="mdui-card-media">
  182. <img src="{{ vid['pic']|picproxy }}"/>
  183. <div class="mdui-card-media-covered mdui-card-media-covered-transparent">
  184. <div class="mdui-card-primary">
  185. <div class="mdui-card-primary-subtitle mdui-color-theme-accent">UP: {{ vid['owner']['name'] }}</div>
  186. <div class="mdui-card-primary-subtitle mdui-color-theme-accent">播放:{{ vid['stat']['view'] }}</div>
  187. </div>
  188. </div>
  189. </div>
  190. <div class="mdui-card-actions">
  191. <a href="/video/av{{ vid['aid'] }}">{{ vid['title'] }}</a>
  192. </div>
  193. </div>
  194. </div>
  195. {% endfor %}
  196. </div>
  197. </div>
  198. </div>
  199. </div>
  200. {% include 'footer.html' %}
  201. <script src="/static/js/video.js"></script>
  202. </body>
  203. </html>