A smart DanmuPlayer with a function to prevent people from being blocked.
You can use this as standalone es5 bundle like this:
<link rel="stylesheet" href="src/maskDanmuPlayer.css"/>
<script src="src/jquery-2.1.4.min.js"></script>
<script src="src/CommentCoreLibrary.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@1.0.0"></script>
<script src="src/util.js"></script>
<script src="src/ModelWeights.js"></script>
<script src="src/mobileNet.js"></script>
<script src="src/SemanticSegmentation.js"></script>
<script src="src/maskDanmuPlayer.js"></script>For the convenience of debugging, we haven't packaged or compressed the code.
<div id="player" style="margin:50px auto;position:relative"></div> $('#player').H5Player(
{
width: "800" ,
height: "450",
src:"video.mp4",
comments:"danmu.xml",
modelAddress:"model.json",
testcanva:canva
});-
width the player's width
-
height the player's height. Note:only the video's height, all the player's height will be this add 37px;
-
src the video file route
-
comments the Danmu file route. More information can be find here
-
modelAddress the address of the cheakpoint. you can find one cheakpoint at here.All files in the folder is necessary and the modelAddress means the route of the "model.json". For example, if you want to use our model weight, the modelAddress can be given as "http://www.acgtrip.com/static/semanticDemoweb_model/model.json".
-
testcanva if you want to show the mask layer for test, give the canve object here.
This program use the artificial neural network to get the mask layer, if you want to learn more about the network ,please move on to browser-semantic-segmentation, our sister project.
This work use the danmaku comments CommentCoreLibrary
- Mobile Adaptation
The program is licensed MIT.