This commit is contained in:
vdalex
2024-02-13 11:35:58 +03:00
parent e34f590c0c
commit 6147a019f8
8 changed files with 6099 additions and 6403 deletions

17
.prettierrc.js Normal file
View File

@@ -0,0 +1,17 @@
module.exports = {
printWidth: 100,
bracketSpacing: false,
useTabs: true,
singleQuote: true,
trailingComma: 'all',
arrowParens: 'avoid',
endOfLine: 'lf',
overrides: [
{
files: "*.js",
options: {
parser: "flow"
}
}
]
};

File diff suppressed because one or more lines are too long

View File

@@ -1,57 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>RTSPtoWEBPlayer demo</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<script src="dist/RTSPtoWEBPlayer.js"></script>
</head>
<body>
<div class="container">
<h2 class="text-center mt-3">RTSPtoWEBPlayer Example</h2>
<div class="row">
<div class="col-12">
<div class="input-group mb-3">
<input type="text" class="form-control" placeholder="url link" id="link"
value=""/>
<button class="btn btn-outline-secondary" type="button" onclick="play()">PLAY</button>
</div>
<h6 class="text-center mb-3"><small><a href="#" id="outerLink"></a></small></h6>
</div>
<div class="col-12">
<div id="player"></div>
</div>
</div>
</div>
</body>
<script>
const options={
parentElement: document.getElementById('player'),
debug: true
};
const player=new RTSPtoWEBPlayer(options);
const play = ()=>{
const link=document.getElementById("link").value;
const url=new URL(window.location.href);
if(link!==''){
player.load(link);
outerLink.innerHTML=`${url.origin+url.pathname+url.search}#${link}`;
outerLink.setAttribute('href',`${url.origin+url.pathname+url.search}#${link}`)
}
}
if(window.location.hash){
try{
const href=new URL(window.location.hash.substr(1));
document.getElementById("link").value=window.location.hash.substr(1);
play();
}catch (e){
console.log(e);
}
}
</script>
</html>

10997
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -4,8 +4,9 @@
"description": "js player for RTSPtoWEB",
"main": "./src/RTSPtoWEBPlayer.js",
"scripts": {
"build": "webpack",
"serve": "webpack serve"
"build": "webpack --progress --color",
"serve": "webpack-dev-server --progress --color",
"prettier": "npx prettier --write \"src/*.*\""
},
"repository": {
"type": "git",
@@ -18,24 +19,27 @@
},
"homepage": "https://github.com/vdalex25/rtsp-to-web-player#readme",
"devDependencies": {
"@babel/cli": "^7.0.0-beta.40",
"@babel/core": "^7.0.0-beta.40",
"@babel/plugin-proposal-class-properties": "^7.16.0",
"@babel/preset-env": "^7.16.4",
"babel-loader": "^8.0.0-beta.0",
"@babel/cli": "^7.23.9",
"@babel/core": "^7.23.9",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/plugin-transform-class-properties": "^7.23.3",
"@babel/preset-env": "^7.23.9",
"babel-loader": "^9.1.3",
"babel-plugin-lodash": "^3.3.2",
"css-loader": "^5.2.6",
"eslint": "^8.8.0",
"css-loader": "^6.10.0",
"eslint": "^8.56.0",
"eslint-config-google": "^0.14.0",
"eslint-plugin-react": "^7.28.0",
"prettier": "2.8.2",
"style-loader": "^2.0.0",
"webpack-cli": "^4.9.2",
"webpack-dev-server": "^4.11.1"
"eslint-plugin-react": "^7.33.2",
"prettier": "^3.2.5",
"style-loader": "^3.3.4",
"webpack": "^5.90.1",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^5.0.0"
},
"dependencies": {
"@babel/eslint-parser": "^7.17.0",
"hls.js": "^1.1.5",
"webrtc-adapter": "^8.1.0"
"@babel/eslint-parser": "^7.23.10",
"ajv": "^8.12.0",
"hls.js": "^1.5.4",
"webrtc-adapter": "^8.2.3"
}
}

View File

@@ -1,9 +1,10 @@
.RTSPtoWEBPlayer {
width: 100%;
height: 100%;
width: 100%;
height: 100%;
}
.RTSPtoWEBPlayer video {
width: 100%;
height: 100%;
background: black;
width: 100%;
height: 100%;
background: black;
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,7 @@
const path = require("path");
module.exports = {
mode: "production", //production,development
mode: "development", //production,development
watch: false,
target: "web",
entry: {