Skip to content

Commit 2653c42

Browse files
authored
Merge pull request #1860 from gbetous-missingno/fixhttp
HTTPVideo: Allow to specify port in URL
2 parents c246fab + 6456948 commit 2653c42

2 files changed

Lines changed: 15 additions & 3 deletions

File tree

labgrid/driver/httpvideodriver.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,11 @@ def get_qualities(self):
2121
return ("high", [("high", None)])
2222

2323
@Driver.check_active
24-
def stream(self, quality_hint=None):
24+
def stream(self, quality_hint=None, controls=None):
2525
s = urlsplit(self.video.url)
26-
if s.scheme == "http":
26+
if s.port:
27+
default_port = s.port
28+
elif s.scheme == "http":
2729
default_port = 80
2830
elif s.scheme == "https":
2931
default_port = 443

tests/test_httpvideo.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,17 @@
22
from labgrid.driver.httpvideodriver import HTTPVideoDriver
33

44

5-
def test_ipvideo_create(target):
5+
def test_ipvideo_create_http(target):
66
r = HTTPVideoStream(target, name=None, url="http://localhost/")
77
d = HTTPVideoDriver(target, name=None)
88
assert isinstance(d, HTTPVideoDriver)
9+
10+
def test_ipvideo_create_https(target):
11+
r = HTTPVideoStream(target, name=None, url="https://localhost/")
12+
d = HTTPVideoDriver(target, name=None)
13+
assert isinstance(d, HTTPVideoDriver)
14+
15+
def test_ipvideo_create_with_port(target):
16+
r = HTTPVideoStream(target, name=None, url="http://localhost:8080/")
17+
d = HTTPVideoDriver(target, name=None)
18+
assert isinstance(d, HTTPVideoDriver)

0 commit comments

Comments
 (0)