Skip to content

Commit faaac63

Browse files
committed
refactor: rename play_hls -> play_stream
1 parent c860321 commit faaac63

File tree

6 files changed

+12
-11
lines changed

6 files changed

+12
-11
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ dist/*
1515
venv/
1616
.vscode/*
1717
example.ipynb
18+
example.py

videodb/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import logging
55

66
from typing import Optional
7-
from videodb._utils._video import play_hls
7+
from videodb._utils._video import play_stream
88
from videodb._constants import VIDEO_DB_API
99
from videodb.client import Connection
1010
from videodb.exceptions import (
@@ -24,7 +24,7 @@
2424
"AuthenticationError",
2525
"InvalidRequestError",
2626
"SearchError",
27-
"play_hls",
27+
"play_stream",
2828
]
2929

3030

videodb/_utils/_video.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
from videodb._constants import PLAYER_URL
44

55

6-
def play_hls(url: str):
7-
"""Play a hls stream url in the browser/ notebook
6+
def play_stream(url: str):
7+
"""Play a stream url in the browser/ notebook
88
9-
:param str url: The url of the hls stream
9+
:param str url: The url of the stream
1010
:return: The player url if the stream is opened in the browser or the iframe if the stream is opened in the notebook
1111
"""
1212
player = f"{PLAYER_URL}?url={url}"

videodb/search.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from abc import ABC, abstractmethod
2-
from videodb._utils._video import play_hls
2+
from videodb._utils._video import play_stream
33
from videodb._constants import (
44
SearchType,
55
ApiPath,
@@ -86,7 +86,7 @@ def play(self) -> str:
8686
:rtype: str
8787
"""
8888
self.compile()
89-
return play_hls(self.stream_url)
89+
return play_stream(self.stream_url)
9090

9191

9292
class Search(ABC):

videodb/shot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33

44
from typing import Optional
5-
from videodb._utils._video import play_hls
5+
from videodb._utils._video import play_stream
66
from videodb._constants import (
77
ApiPath,
88
)
@@ -78,4 +78,4 @@ def play(self) -> str:
7878
:rtype: str
7979
"""
8080
self.generate_stream()
81-
return play_hls(self.stream_url)
81+
return play_stream(self.stream_url)

videodb/video.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from typing import Optional
2-
from videodb._utils._video import play_hls
2+
from videodb._utils._video import play_stream
33
from videodb._constants import (
44
ApiPath,
55
SearchType,
@@ -182,4 +182,4 @@ def play(self) -> str:
182182
:return: The stream url
183183
:rtype: str
184184
"""
185-
return play_hls(self.stream_url)
185+
return play_stream(self.stream_url)

0 commit comments

Comments
 (0)