{"id":22039525,"url":"https://github.com/mpolinowski/html5_video_prefix","last_synced_at":"2026-05-11T04:32:10.741Z","repository":{"id":40606470,"uuid":"327360561","full_name":"mpolinowski/html5_video_prefix","owner":"mpolinowski","description":"Add your IP camera live video to your HTML5 website. NGINX configuration to handle a URL prefix for your web service.","archived":false,"fork":false,"pushed_at":"2021-01-06T15:59:52.000Z","size":2861,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-28T19:17:43.814Z","etag":null,"topics":["nginx","nginx-configuration","nginx-docker"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mpolinowski.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-01-06T15:58:56.000Z","updated_at":"2022-06-27T02:02:55.000Z","dependencies_parsed_at":"2022-09-04T10:32:46.900Z","dependency_job_id":null,"html_url":"https://github.com/mpolinowski/html5_video_prefix","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpolinowski%2Fhtml5_video_prefix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpolinowski%2Fhtml5_video_prefix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpolinowski%2Fhtml5_video_prefix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpolinowski%2Fhtml5_video_prefix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mpolinowski","download_url":"https://codeload.github.com/mpolinowski/html5_video_prefix/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245104529,"owners_count":20561380,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["nginx","nginx-configuration","nginx-docker"],"created_at":"2024-11-30T11:11:06.342Z","updated_at":"2026-05-11T04:32:05.706Z","avatar_url":"https://github.com/mpolinowski.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# INSTAR IP Camera HTML5 Video Stream\n\n## How to use with an URL Prefix\n\n### Prepare the HTML\n\nStart by cloning this repository to `/opt/html5_video_prefix` and start editing the 3 `index.html` files inside the public directory for __server1__ - __server3__:\n\n\n```bash\n/opt/html5_video_prefix\n├── conf\n│  └── default.conf\n├── docker-compose.yml\n└── public\n   ├── server1\n   │  ├── index.html\n   │  └── js\n   ├── server2\n   │  ├── index.html\n   │  └── js\n   ├── server3\n   │  ├── index.html\n   │  └── js\n```\n\n\nAdd your camera [IP, HTTP Port and Login](https://wiki.instar.com/en/Advanced_User/Website_Integration/HTML5_Stream_Full_HD_Cameras/):\n\n\n```html\n\u003c!-- this is the video the video element --\u003e\n\u003ccanvas id=\"activeVideo\" width=\"1280\" height=\"720\"\u003e\u003c/canvas\u003e\n\n\u003cscript\u003e\n    \n    var cam_host     = '192.168.2.122'; // DDNS or local ip\n    var cam_port     = 80; // http port\n\n    var cam_user     = 'admin'; // credentials for guest account recommended\n    var cam_pass     = 'instar'; // credentials for guest account recommended\n\n    var cam_stream   = 11; // 11 = FullHD; 12 medium res, 13 small res\n\n    var canvas = document.getElementById(\"activeVideo\");\n    \n    var player = null;\n    \n    function startvideo(cam_host, cam_port, cam_stream, cam_user, cam_pass){\n        // init video player\n        player = new HxPlayer();\n        self.player.init({canvas:canvas,width:640,height:352});\n\n        // play video\n        player.playvideo(cam_host, cam_port, cam_stream, cam_user, cam_pass);\n    }\n\n    function stopvideo(){\n        // stop video\n        player.stopvideo();\n        player = null;\n    }\n    \n    \n    // initialize and play video\n    \n    startvideo(cam_host, cam_port, cam_stream, cam_user, cam_pass)\n    \n    \n\n\u003c/script\u003e\n```\n\n\n\n### Run your Webserver\n\nRun the `docker-compose` file from this repository:\n\n\n```bash\nversion: \"3.8\"\nservices:\n\n    ingress:\n        image: nginx:stable-alpine\n        container_name: ingress\n        networks:\n            - gateway\n        ports:\n            - \"80:80\"\n        restart: unless-stopped\n        volumes:\n            - /opt/html5_video_prefix/conf/default.conf:/etc/nginx/conf.d/default.conf\n            - /opt/html5_video_prefix/public:/opt/html5_video_prefix/public\n\nnetworks:\n  gateway: {}\n```\n\nThis will pull the latest NGINX image from DockerHUB and mount your HTML code as well as a simple NGINX server configuration file:\n\n\n```conf\nserver {\n    listen       80;\n    listen  [::]:80;\n    server_name  localhost;\n\n    location / {\n        rewrite   ^/(.*)$  /server1/$1  permanent;\n    }\n\n    location /server1 {\n        autoindex on;\n        root  /opt/html5_video_prefix/public;\n    }\n\n    location /server2 {\n        autoindex on;\n        root  /opt/html5_video_prefix/public;\n    }\n\n    location /server3 {\n        autoindex on;\n        root  /opt/html5_video_prefix/public;\n    }\n    \n    error_page   500 502 503 504  /50x.html;\n    location = /50x.html {\n        root   /usr/share/nginx/html;\n    }\n}\n```\n\n\n```bash\ndocker-compose up\n\nCreating network \"html5_video_prefix_gateway\" with the default driver\nCreating ingress ... done\nAttaching to ingress\ningress    | /docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration\ningress    | /docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/\ningress    | /docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh\ningress    | 10-listen-on-ipv6-by-default.sh: info: IPv6 listen already enabled\ningress    | /docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh\ningress    | /docker-entrypoint.sh: Configuration complete; ready for start up\n```\n\n\nYou can now access the web service on your server IP address, e.g.:\n\n\n```bash\nhttp://192.168.2.111/server1/\nhttp://192.168.2.111/server2/\nhttp://192.168.2.111/server3/\n```\n\n\n![NGINX HTML5 Video](./nginx_html5_video.gif)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmpolinowski%2Fhtml5_video_prefix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmpolinowski%2Fhtml5_video_prefix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmpolinowski%2Fhtml5_video_prefix/lists"}