Add unfinished video player code #5

It's not working, but maybe I'll revisit it later.
This commit is contained in:
gg 2023-09-04 21:04:45 -07:00
parent 075a9bfc72
commit a8c2ed2ca7
3 changed files with 68 additions and 0 deletions

35
www/vid.cgi Executable file
View File

@ -0,0 +1,35 @@
#!/usr/bin/env perl
use strict;
use warnings;
use local::lib;
use DBI;
use DBD::SQLite;
use CGI::Tiny;
require('./WNDB.pm');
require('./Utils.pm');
our %config = (
base => "/",
database => "dbi:SQLite:dbname=wn.db"
);
if (-e "./config.pl") {
%config = (%config, do "./config.pl");
}
my $dbh = DBI->connect($config{database});
my ($sql, $do) = sql_fn($dbh);
cgi {
my $cgi = $_;
my $id = $cgi->query_param('video_id');
my $poster = aupay_th($id);
my $m3u8 = aupay_m3u8($id);
my $html = page(vid => {
video_id => $id,
poster => $poster,
m3u8 => $m3u8
});
$cgi->render(html => $html);
};

View File

@ -21,6 +21,10 @@
<!--
<link rel="stylesheet" href="https://milligram.io/styles/main.css" />
-->
<!--
<link href="https://unpkg.com/video.js/dist/video-js.min.css" rel="stylesheet">
<script src="https://unpkg.com/video.js/dist/video.min.js"></script>
-->
</head>
<body>
<main class="wrapper">

29
www/xslate/vid.html Normal file
View File

@ -0,0 +1,29 @@
<section class="container" id="rankings">
<div class="row">
<div class="column">
<script>window.HELP_IMPROVE_VIDEOJS = false;</script>
<video
id="my-player"
class=""
controls
preload="auto"
width="1080"
height="1920"
poster="<: $poster :>"
data-setup='{}'>
<source src="<: $m3u8 :>"></source>
<p class="vjs-no-js">
To view this video please enable JavaScript, and consider upgrading to a
web browser that
<a href="https://videojs.com/html5-video-support/" target="_blank">
supports HTML5 video
</a>
</p>
</video>
</div>
</div>
</section>