Skip to content

Commit a242b17

Browse files
authored
Add files via upload
1 parent 7b0eeef commit a242b17

File tree

2 files changed

+113
-0
lines changed

2 files changed

+113
-0
lines changed

main.py

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
from requests.api import get
2+
from vidstream import *
3+
import tkinter as tk
4+
import socket as sok
5+
import threading as thr
6+
import requests
7+
8+
local_ip_adress = sok.gethostbyname(sok.gethostname())
9+
10+
server = StreamingServer(local_ip_adress, 9999)
11+
receiver = AudioReceiver(local_ip_adress, 8888)
12+
13+
def start_listening():
14+
t1 = thr.Thread(target=server.start_server)
15+
t2 = thr.Thread(target=receiver.start_server)
16+
t1.start()
17+
t2.start()
18+
19+
def start_camera_stream():
20+
camera_client = CameraClient(text_target_ip.get(1.0, 'end-1c'), 7777)
21+
t3 = thr.Thread(target=camera_client.start_stream)
22+
t3.start()
23+
24+
def start_screen_sharing():
25+
screen_client = ScreenShareClient(text_target_ip.get(1.0, 'end-1c'), 7777)
26+
t4 = thr.Thread(target=screen_client.start_stream)
27+
t4.start()
28+
29+
def start_audio_stream():
30+
audio_sender = AudioReceiver(text_target_ip.get(1.0, 'end-1c'), 6666)
31+
t5 = thr.Thread(target=audio_sender.start_stream)
32+
t5.start()
33+
34+
35+
window = tk.Tk()
36+
window.title("Python Zoom Clone")
37+
window.geometry('300x200')
38+
39+
text_target_ip = tk.Text(window, height=1)
40+
text_target_ip.pack()
41+
42+
label_target_ip = tk.Label(window, text="Target Ip:")
43+
label_target_ip.pack()
44+
45+
btn_listen = tk.Button(window, text="Eshitishni boshlash", width=50, command=start_listening)
46+
btn_listen.pack(anchor=tk.CENTER, expand=True)
47+
48+
btn_camera = tk.Button(window, text="Camerani yoqish", width=50, command=start_camera_stream)
49+
btn_camera.pack(anchor=tk.CENTER, expand=True)
50+
51+
btn_screen = tk.Button(window, text="Screen qilish", width=50, command=start_screen_sharing)
52+
btn_screen.pack(anchor=tk.CENTER, expand=True)
53+
54+
btn_audio = tk.Button(window, text="Audio yozish", width=50, command=start_audio_stream)
55+
btn_audio.pack(anchor=tk.CENTER, expand=True)
56+
57+
window.mainloop()

main2.py

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
from requests.api import get
2+
from vidstream import *
3+
import tkinter as tk
4+
import socket as sok
5+
import threading as thr
6+
7+
local_ip_adress = sok.gethostbyname(sok.gethostname())
8+
9+
server = StreamingServer(local_ip_adress, 7777)
10+
receiver = AudioReceiver(local_ip_adress, 6666)
11+
12+
def start_listening():
13+
t1 = thr.Thread(target=server.start_server)
14+
t2 = thr.Thread(target=receiver.start_server)
15+
t1.start()
16+
t2.start()
17+
18+
def start_camera_stream():
19+
camera_client = CameraClient(text_target_ip.get(1.0, 'end-1c'), 9999)
20+
t3 = thr.Thread(target=camera_client.start_stream)
21+
t3.start()
22+
23+
def start_screen_sharing():
24+
screen_client = ScreenShareClient(text_target_ip.get(1.0, 'end-1c'), 9999)
25+
t4 = thr.Thread(target=screen_client.start_stream)
26+
t4.start()
27+
28+
def start_audio_stream():
29+
audio_sender = AudioReceiver(text_target_ip.get(1.0, 'end-1c'), 8888)
30+
t5 = thr.Thread(target=audio_sender.start_stream)
31+
t5.start()
32+
33+
34+
window = tk.Tk()
35+
window.title("Python Zoom Clone")
36+
window.geometry('300x200')
37+
38+
text_target_ip = tk.Text(window, height=1)
39+
text_target_ip.pack()
40+
41+
label_target_ip = tk.Label(window, text="Target Ip:")
42+
label_target_ip.pack()
43+
44+
btn_listen = tk.Button(window, text="Eshitishni boshlash", width=50, command=start_listening)
45+
btn_listen.pack(anchor=tk.CENTER, expand=True)
46+
47+
btn_camera = tk.Button(window, text="Camerani yoqish", width=50, command=start_camera_stream)
48+
btn_camera.pack(anchor=tk.CENTER, expand=True)
49+
50+
btn_screen = tk.Button(window, text="Screen qilish", width=50, command=start_screen_sharing)
51+
btn_screen.pack(anchor=tk.CENTER, expand=True)
52+
53+
btn_audio = tk.Button(window, text="Audio yozish", width=50, command=start_audio_stream)
54+
btn_audio.pack(anchor=tk.CENTER, expand=True)
55+
56+
window.mainloop()

0 commit comments

Comments
 (0)