{"id":15538762,"url":"https://github.com/formix/vlcplayer-node","last_synced_at":"2025-04-23T15:40:57.370Z","repository":{"id":143584849,"uuid":"613614829","full_name":"formix/vlcplayer-node","owner":"formix","description":"A library for controlling VLC player on any system and OS including Raspberry PI.","archived":false,"fork":false,"pushed_at":"2023-03-24T19:58:02.000Z","size":45,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-19T19:04:13.816Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/formix.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-13T23:24:02.000Z","updated_at":"2025-02-21T02:36:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"7cc16b38-1293-475f-80f1-8a7a1a9258ad","html_url":"https://github.com/formix/vlcplayer-node","commit_stats":{"total_commits":25,"total_committers":1,"mean_commits":25.0,"dds":0.0,"last_synced_commit":"5ecd0c22d6607408a81784c64773dda4766841b5"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/formix%2Fvlcplayer-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/formix%2Fvlcplayer-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/formix%2Fvlcplayer-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/formix%2Fvlcplayer-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/formix","download_url":"https://codeload.github.com/formix/vlcplayer-node/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250461866,"owners_count":21434496,"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":[],"created_at":"2024-10-02T12:06:15.940Z","updated_at":"2025-04-23T15:40:57.352Z","avatar_url":"https://github.com/formix.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vlcplayer-node\nA library for controlling VLC player on Raspberry PI. The current version is tested on a Rapsberry\nPI 2GB of RAM without any UI.\n\n# Installation\n```bash\nsudo apt install vlc\nnpm install --save vlcplayer-node\n```\n# Usage\nVlcPLayer is not an event emitter. Your logic have to take in consideration that you are handling\na playlist. With this paradigm, you have to take video timing in consideration if you want to\nrepeat a sequence or play something else based on external events. Look at the following example:\n\n```javascript\nimport { VlcPlayer, sleep } from \"vlcplayer-node\"\n\nlet mediasHome = \"/var/medias/\";\nconst VIDEOS = {\n    BadWeather: `${mediasHome}2019_sc02_067_v001_BUFFER1-1080.mp4`, // 20 seconds\n    Tornado: `${mediasHome}2019_sc02_067_v001_TRIGGER1-1080.mp4`,   // 20 seconds\n    Flying: `${mediasHome}2019_sc02_067_v001_BUFFER2-1080.mp4`,     // 20 seconds\n    FallDown: `${mediasHome}2019_sc02_067_v001_TRIGGER2-1080.mp4`,  // 13 seconds\n    CropField: `${mediasHome}2019_sc02_067_v001_BUFFER3-1080.mp4`   // 20 seconds\n};\n\nlet player = new VlcPlayer();\nawait player.open();\nfor (let key in VIDEOS) {\n    await player.add(VIDEOS[key]);\n}\nawait player.play(VIDEOS.BadWeather);\nawait player.repeat(\"on\");\nawait sleep(25);\nawait player.play(VIDEOS.Tornado);\nawait player.repeat(\"off\");\nawait sleep(22);\nawait player.repeat(\"on\");\nawait sleep(30);\nawait player.play(VIDEOS.FallDown);\nawait player.repeat(\"off\");\nawait sleep(15);\nawait player.repeat(\"on\");\nawait sleep(30);\nawait player.close();\n```\n\nThe code adds all videos to the playlist, in declaration order. After the `for` loop, the first\nvideo (`BadWeather`) is displayed in the paused state, but you may not notice that since there is\nno sleep before the play command is called. Then the whole thing is played in that sequence:\n\n  1. The `BadWeather` video starts.\n  2. Activate the repeat mode.\n  3. Sleep 25 seconds. Since `BadWather` is only 20 seconds long, it will repeat and play for another 5 seconds.\n  4. The `Tornado` video starts.\n  5. Turn off video repetion.\n  6. Sleep 22 seconds. Since the `Tornado` video is 20 seconds long, the `Flying` video will start right after.\n  7. Turn on video repetition. The `Flying` video will repeat itself.\n  8. Waiting 30 seconds means that the `Flying` video repeats and play for another 10 seconds.\n  9. Jump to the `FallDown` video.\n  10. Turn off video repetion.\n  11. Waiting for 15 seconds will let the player jump to `CropField` since `FallDown` duration is only 13 seconds.\n  12. Turn on video repetition. The `CropField` video will repeat itself.\n  13. Waiting 30 seconds means that the `CropField` video repeats and play for another 10 seconds.\n  14. The player shuts down.\n\nFrom there, you got the gist of it. You could as well repeat the whole sequence by wrapping 1-12\ninto a while loop instead of closing. You could aso leave the `CropField` video run indefinitely\nor until a given event.\n\nYou can also call `player.exec()` to execute any rc command that is not implemented right away. If\nyou think that there is some other good abstraction to add to the player, feel free to implement\nthat function send a pull request my way! Want to make it work under another OS? Don't ask me\nwhat I can do for you, ask yourself what you can do to make it happend... and send me a pull\nrequest with your own cross platform implemetation!\n\nI developped this module after the OMX Player deprecation for my escape games consulting work.\nTested and working on Raspberry PI 4 with the minimal Raspbian image (console only).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fformix%2Fvlcplayer-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fformix%2Fvlcplayer-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fformix%2Fvlcplayer-node/lists"}