#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';
#access_log logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root html;
index index.html index.htm index.php;
}
# location / {
# proxy_pass http://127.0.0.1:3000;
# proxy_set_header Host $host;
# }
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
# root html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
#}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
# another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
# listen 8000;
# listen somename:8080;
# server_name somename alias another.alias;
# location / {
# root html;
# index index.html index.htm;
# }
#}
# HTTPS server
#
#server {
# listen 443 ssl;
# server_name localhost;
# ssl_certificate cert.pem;
# ssl_certificate_key cert.key;
# ssl_session_cache shared:SSL:1m;
# ssl_session_timeout 5m;
# ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on;
# location / {
# root html;
# index index.html index.htm;
# }
#}
}
#EXTM3U
#EXT-X-TARGETDURATION:61
#EXT-X-PLAYLIST-TYPE:VOD
#EXTINF:60,
live000.ts
#EXTINF:60,
live001.ts
****
тут чанки ваши прописываем.
****
#EXTINF:60,
live005.ts
#EXT-X-ENDLIST
$file = "record.m3u8";
//если файла нету... тогда
if( !file_exists($file)) {
$fp = fopen($file, "w"); // ("r" - считывать "w" - создавать "a" - добовлять к тексту), мы создаем файл
fwrite($fp, "#EXTM3U\n #EXT-X-TARGETDURATION:10\n #EXT-X-PLAYLIST-TYPE:VOD\n");
for($i = 0; $i < 6; ++$i){
fwrite($fp, sprintf("#EXTINF:60,\nlive%03d.ts\n", $i));
}
fwrite($fp,"#EXT-X-ENDLIST");
fclose ($fp);
}
/var/node/client.js:9
window.onload = function() {
^
ReferenceError: window is not defined
at Object.<anonymous> (/var/node/client.js:9:1)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:906:3
strings = {
'connected': '[sys][time]%time%[/time]: Вы успешно соединились к сервером как [user]%name%[/user].[/sys]',
'userJoined': '[sys][time]%time%[/time]: Пользователь [user]%name%[/user] присоединился к чату.[/sys]',
'messageSent': '[out][time]%time%[/time]: [user]%name%[/user]: %text%[/out]',
'messageReceived': '[in][time]%time%[/time]: [user]%name%[/user]: %text%[/in]',
'userSplit': '[sys][time]%time%[/time]: Пользователь [user]%name%[/user] покинул чат.[/sys]'
};
window.onload = function() {
if (navigator.userAgent.toLowerCase().indexOf('chrome') != -1) {
socket = io.connect('http://127.0.0.1:8080', {'transports': ['xhr-polling']});
} else {
socket = io.connect('http://127.0.0.1:8080');
}
socket.on('connect', function () {
socket.on('message', function (msg) {
// Добавляем в лог сообщение, заменив время, имя и текст на полученные
document.querySelector('#log').innerHTML += strings[msg.event].replace(/\[([a-z]+)\]/g, '<span class="$1">').replace(/\[\/[a-z]+\]/g, '</span>').replace(/\%time\%/, msg.time).replace(/\%name\%/, msg.name).replace(/\%text\%/, unescape(msg.text).replace('<', '<').replace('>', '>')) + '<br>';
// Прокручиваем лог в конец
document.querySelector('#log').scrollTop = document.querySelector('#log').scrollHeight;
});
document.querySelector('#input').onkeypress = function(e) {
if (e.which == '13') {
socket.send(escape(document.querySelector('#input').value));
// Очищаем input
document.querySelector('#input').value = '';
}
};
document.querySelector('#send').onclick = function() {
socket.send(escape(document.querySelector('#input').value));
document.querySelector('#input').value = '';
};
});
};