You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+39-19Lines changed: 39 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -11,29 +11,49 @@ _Recently I wrote an article, explaining how to deploy it using systemd in LAN,
11
11
- Frontend, powered by _HTML_, _CSS_ & last but not least _Javascript__( yeah not using any UI framework )_
12
12
- Audio-Video playing is done using HTML5 **\<video>** element, which can play _mp4_ & _webm_ video(s) generally
13
13
## how can I use it ?
14
-
- Simply fork this repo & clone it in you machine
15
-
- Make sure you've installed _Dart SDK_ & you're on _*nix_ platform
16
-
- Because I gonna use _systemd.service_ to keep this streaming service alive in background, always, even after system restarts it'll auto start itself
17
-
- You need to make sure, you've _~/Videos/_ directory present on your system, cause we'll read from that directory _( every 30 minutes )_, to ensure all _mp4_ & _webm_
18
-
videos, present in aforementioned directory, are listed in movie playlist
19
-
- Start streaming server, which will be available via port 8000
14
+
- If you're on _Linux_, then I've already compiled **streamZ** into an executable binary _( using dart2native compiler )_, which can be simply run on any Linux Machine, cause that executable binary is one self-sufficient one _( but not yet platform-agnostic, which will change is near future )_.
15
+
- Then download [_this_](.) compressed file, and unzip it into a suitable location on your machine.
16
+
- You'll get a directory tree like below
20
17
```shell script
21
-
$ cd bin # assuming you're already at root of project directory
22
-
$ dart main.dart
23
-
```
24
-
- Consider using _Ahead Of Time_-compiled version _( at production )_, for better performance
25
-
```shell script
26
-
$ dart2aot main.dart main.dart.aot // compilation
27
-
$ dartaotruntime main.dart.aot
18
+
$ cd
19
+
$ unzip streamZ.zip # unzipping it
20
+
$ cd streamZ # getting into actual directory
21
+
$ tree -h
22
+
.
23
+
├── [4.0K] final
24
+
│ └── [7.8M] streamZ
25
+
└── [4.0K] frontend
26
+
├── [4.0K] images
27
+
│ └── [ 318] favicon.ico
28
+
├── [4.0K] pages
29
+
│ └── [1.0K] index.html
30
+
├── [4.0K] scripts
31
+
│ └── [9.7K] index.js
32
+
└── [4.0K] styles
33
+
└── [2.0K] index.css
34
+
35
+
6 directories, 5 files
28
36
```
29
-
-If you're having a lot of traffic, consider using multiple Isolates to handle traffic efficiently
37
+
-Now get into `./final` directory & run executable binary, which will start a media streaming server on _http://0.0.0.0:8000_
30
38
```shell script
31
-
$ dartaotruntime main.dart.aot 2 // using two Isolates
32
-
$ dartaotruntime main.dart.aot n // using n Isolates, n >= 1
39
+
$ cd final
40
+
$ ./streamZ # running movie steaming server
41
+
[+]streamZ_v1.0.0 listening ( streamZ0 ) ...
42
+
43
+
[+]streamZ_v1.0.0 listening ( streamZ1 ) ...
44
+
33
45
```
34
-
- Now you can simply use this streaming service by opening `http://ip-addr-server:8000/`, on any device's browser present in LAN
35
-
- For using service from same machine, simply use `http://localhost:8000/` from your favourite browser
36
-
- Deploying via _systemd.service_, to be explained in a blog post, to be published soon
46
+
- To check, open browser from same machine & type _http://localhost:8000_ into address bar, you'll get a list of all movies present under _~/Videos/_ directory, which is default video storing directory on _Linux_ running machines.
47
+
- You can also access this streaming service by opening _http://x.x.x.x:8000/_,on any device's browser, present in LAN
48
+
- Where `x.x.x.x` is nothing but Local IP Address of machine, running **streamZ**
49
+
---
50
+
- If you want to dig deeper, simply fork this repo & clone it in you machine
51
+
- Make sure you've installed _Dart SDK_ & you're on _*nix_ platform
52
+
- Because I gonna use _systemd.service_ to keep this streaming service alive in background, always, even after system restarts it'll auto start itself
53
+
- You need to make sure, you've _~/Videos/_ directory present on your system, cause we'll read from that directory _( every 30 minutes )_, to ensure all _mp4_ & _webm_ videos, present in aforementioned directory, are listed in movie playlist
54
+
- If you're having a lot of traffic, consider using multiple Isolates to handle traffic efficiently. Just update `int count = 2;` on line 100 of `./bin/main.dart` to whatever value you intend to use, that many Isolate(s) will be created on boot, they'll distributedly handle whole traffic coming in.
55
+
- I've also written one systemd unit file, which can be used for deploying **streamZ**, so that it'll keep running always _( autostart after failure & system boot )_
56
+
- Consider using so, by modifying this systemd unit [file](./systemd/streamZ.service)
0 commit comments