Add video support with special tag

This commit is contained in:
Nicolas H 2022-04-15 12:40:52 +02:00
parent dd717e331c
commit b0d16ccfe7
3 changed files with 54 additions and 25 deletions

View File

@ -1,3 +1,9 @@
.video-js-style {
position: relative !important;
width: 100% !important;
height: auto !important;
}
.navbar-custom { .navbar-custom {
background-color: #ff5500; background-color: #ff5500;
} }

View File

@ -253,9 +253,14 @@ else
<link rel="stylesheet" type="text/css" href="/css/emoji.css" /> <link rel="stylesheet" type="text/css" href="/css/emoji.css" />
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css" /> <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css" />
<link rel="stylesheet" type="text/css" href="/css/style.css" /> <link rel="stylesheet" type="text/css" href="/css/style.css" />
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/vlitejs@4.0.5/dist/plugins/subtitle.min.css" />
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/vlitejs@4.0.5/dist/vlite.min.css" />
<?php print(($_SESSION['md_admin'] == true)?'<link rel="stylesheet" href="/css/codemirror.min.css" />':''); ?> <?php print(($_SESSION['md_admin'] == true)?'<link rel="stylesheet" href="/css/codemirror.min.css" />':''); ?>
</head> </head>
<body> <body>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/vlitejs@4.0.5/dist/plugins/subtitle.min.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/vlitejs@4.0.5/dist/plugins/pip.min.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/vlitejs@4.0.5/dist/vlite.min.js"></script>
<script type="text/javascript" src="/js/jquery.min.js"></script> <script type="text/javascript" src="/js/jquery.min.js"></script>
<script type="text/javascript" src="/js/popper.min.js"></script> <script type="text/javascript" src="/js/popper.min.js"></script>
<script type="text/javascript" src="/js/bootstrap.min.js"></script> <script type="text/javascript" src="/js/bootstrap.min.js"></script>

View File

@ -115,6 +115,8 @@ class ParsedownExtraplus extends ParsedownExtra
return; return;
} }
if ($Link['element']['text']!="video")
{
$Inline = array( $Inline = array(
'extent' => $Link['extent'] + 1, 'extent' => $Link['extent'] + 1,
'element' => array( 'element' => array(
@ -142,7 +144,23 @@ class ParsedownExtraplus extends ParsedownExtra
$Inline['element']['attributes'] += $Link['element']['attributes']; $Inline['element']['attributes'] += $Link['element']['attributes'];
unset($Inline['element']['attributes']['href']); unset($Inline['element']['attributes']['href']);
}
else
{
$Inline = array(
'extent' => $Link['extent'] + 1,
'element' => array(
'name' => 'video',
'attributes' => array(
'src' => $Link['element']['attributes']['href'],
'id' => 'player',
'controls' => '',
'class' => 'v-vlite video-js-style',
'playsinline' => ''
),
),
);
}
return $Inline; return $Inline;
} }