let videoElement = document.createElement("video");
videoElement.setAttribute("id", 'stream2');
videoElement.setAttribute('src', '');
videoElement.setAttribute("width", "auto");
videoElement.setAttribute("height", "auto");
videoElement.setAttribute("controls", "controls");
videoElement.setAttribute("autoplay", "");
videoElement.setAttribute("muted", "");
document.body.append(videoElement);
socket.on('streamVideo', function(bufferVideo){
videoElement.src = URL.createObjectURL(bufferVideo);
});
socket.on('streamVideo', function(bufferVideo){
videoElement.srcObject = bufferVideo;
});
let dom = await response.text();
let codJS = document.getElementById("divJS");
codJS.innerHTML = dom;
//Переменная dom на сервере:
let domServer = `
<p>Новый скрипт</p>
<script id="hello">
let text = document.createElement("p");
text.textContent = 'HelloServer';
document.body.appendChild(text);
</script>`;
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Hello webpack</title>
<script src="..\tennis_pars_fast\test.js"></script>
<script src="C:\Users\evelate\Desktop\Training\node_modules\chart.js\dist\Chart.js"></script>
<script>
var ctx = document.getElementById("myChart");
var myChart = new Chart(ctx, {
type: 'bar',
data: {
labels: ["Red", "Blue", "Yellow", "Green", "Purple", "Orange"],
datasets: [{
label: '# of Votes',
data: [12, 19, 3, 5, 2, 3],
backgroundColor: [
'rgba(255, 99, 132, 0.2)',
'rgba(54, 162, 235, 0.2)',
'rgba(255, 206, 86, 0.2)',
'rgba(75, 192, 192, 0.2)',
'rgba(153, 102, 255, 0.2)',
'rgba(255, 159, 64, 0.2)'
],
borderColor: [
'rgba(255,99,132,1)',
'rgba(54, 162, 235, 1)',
'rgba(255, 206, 86, 1)',
'rgba(75, 192, 192, 1)',
'rgba(153, 102, 255, 1)',
'rgba(255, 159, 64, 1)'
],
borderWidth: 1
}]
},
options: {
scales: {
yAxes: [{
ticks: {
beginAtZero:true
}
}]
}
}
});
</script>
<canvas id="myChart" width="400" height="400"></canvas>
</head>
<body>
</body>
</html>
"use strict"
var Chart = require('Chart.js');
var ctx = document.getElementById("myChart");
var myChart = new Chart(ctx, {
type: 'bar',
data: {
labels: ["Redy", "Bluey", "Yellowy", "Greeny", "Purpley", "Orangey"],
datasets: [{
label: '# of Votes',
data: [12, 19, 3, 5, 2, 3],
backgroundColor: [
'rgba(255, 99, 132, 0.2)',
'rgba(54, 162, 235, 0.2)',
'rgba(255, 206, 86, 0.2)',
'rgba(75, 192, 192, 0.2)',
'rgba(153, 102, 255, 0.2)',
'rgba(255, 159, 64, 0.2)'
],
borderColor: [
'rgba(255,99,132,1)',
'rgba(54, 162, 235, 1)',
'rgba(255, 206, 86, 1)',
'rgba(75, 192, 192, 1)',
'rgba(153, 102, 255, 1)',
'rgba(255, 159, 64, 1)'
],
borderWidth: 1
}]
},
options: {
scales: {
yAxes: [{
ticks: {
beginAtZero:true
}
}]
}
}
});
Правда все-равно не работает(( видео проигрыватель при получении каждой порции буфера, как будто сразу перезагружается, но кадры не показывает, даже мельком