Skip to content

Commit

Permalink
Pull develop
Browse files Browse the repository at this point in the history
  • Loading branch information
AymericJak committed Nov 9, 2023
2 parents a110b0c + 9c0a9e9 commit 945079f
Show file tree
Hide file tree
Showing 13 changed files with 290 additions and 59 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ module.exports = {
"globals": {
"Cookies": "readonly",
"gettext": "readonly",
"ngettext": "readonly",
"interpolate": "readonly",
"bootstrap": "readonly",
"videojs": "readonly",
Expand Down
38 changes: 23 additions & 15 deletions pod/live/pilotingInterface.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"""Esup-Pod Piloting Interface."""
import http
import json
import logging
Expand Down Expand Up @@ -39,8 +40,12 @@ class PilotingInterface(__ABC__):

@abstractmethod
def __init__(self, broadcaster: Broadcaster):
"""Initialize the PilotingInterface
:param broadcaster: the broadcaster to pilot"""
"""
Initialize the PilotingInterface.
Args:
broadcaster(:class:`pod.live.models.Broadcaster`): the broadcaster to pilot
"""
self.broadcaster = broadcaster
raise NotImplementedError

Expand All @@ -56,21 +61,24 @@ def can_split(self) -> bool:

@abstractmethod
def check_piloting_conf(self) -> bool:
"""Checks the piloting conf value."""
"""Check the piloting conf value."""
raise NotImplementedError

@abstractmethod
def is_available_to_record(self) -> bool:
"""Checks if the broadcaster is available."""
"""Check if the broadcaster is available."""
raise NotImplementedError

@abstractmethod
def is_recording(self, with_file_check=False) -> bool:
"""
Returns if the broadcaster is recording state.
Check if the broadcaster is recording state.
Args:
with_file_check(bool): checks if tmp recording file is present on the filesystem,
as recording could have been launch from somewhere else.
with_file_check(bool): checks if tmp recording file is present on the
filesystem, as recording could have been launch from somewhere else.
Returns:
bool: True if the broadcaster is recording state
"""
raise NotImplementedError

Expand Down Expand Up @@ -106,22 +114,22 @@ def can_manage_stream(self) -> bool:

@abstractmethod
def start_stream(self) -> bool:
"""Starts the stream."""
"""Start the stream."""
raise NotImplementedError

@abstractmethod
def stop_stream(self) -> bool:
"""Stops the streams."""
"""Stop the streams."""
raise NotImplementedError

@abstractmethod
def get_stream_rtmp_infos(self) -> dict:
"""Checks if SMP is configured for Rtmp and gets infos."""
"""Check if SMP is configured for Rtmp and gets infos."""
raise NotImplementedError


def ajax_get_mandatory_parameters(request):
"""Returns the mandatory parameters as a json response."""
"""Return the mandatory parameters as a json response."""
if request.method == "GET" and request.is_ajax():
impl_name = request.GET.get("impl_name", None)
params = get_mandatory_parameters(impl_name)
Expand All @@ -135,7 +143,7 @@ def ajax_get_mandatory_parameters(request):


def get_mandatory_parameters(impl_name="") -> List[str]:
"""Returns the mandatory parameters of the implementation."""
"""Return the mandatory parameters of the implementation."""
if impl_name in __MANDATORY_PARAMETERS__:
return __MANDATORY_PARAMETERS__[impl_name]
if impl_name.lower() in __MANDATORY_PARAMETERS__:
Expand All @@ -148,7 +156,7 @@ def get_mandatory_parameters(impl_name="") -> List[str]:


def validate_json_implementation(broadcaster: Broadcaster) -> bool:
"""Returns if the config value is json formatted and has all the mandatory parameters."""
"""Return if the config value is json formatted and has all mandatory params."""
conf = broadcaster.piloting_conf
if not conf:
logger.error(
Expand Down Expand Up @@ -186,7 +194,7 @@ def validate_json_implementation(broadcaster: Broadcaster) -> bool:


def get_piloting_implementation(broadcaster) -> Optional[PilotingInterface]:
"""Returns the class inheriting from PilotingInterface according to the broadcaster configuration (or None)."""
"""Return the class inheriting from PilotingInterface according to the broadcaster configuration (or None)."""
if broadcaster is None:
return None

Expand Down Expand Up @@ -237,7 +245,7 @@ def get_piloting_implementation(broadcaster) -> Optional[PilotingInterface]:


def is_recording_launched_by_pod(self) -> bool:
"""Returns if the current recording has been launched by Pod."""
"""Return if the current recording has been launched by Pod."""
# Fetch file name of current recording
current_record_info = self.get_info_current_record()
filename = current_record_info.get("currentFile", None)
Expand Down
28 changes: 24 additions & 4 deletions pod/live/templates/live/event-iframe.html
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,11 @@ <h2 class="video-title">{{ event.title }}</h2>
<source src="{{ event.broadcaster.url }}" type="application/x-mpegURL">
</video>
</div>
{# ajouter ici l' event.aside_iframe_url si nécessaire #}
{# ajouter ici le chatBBB si nécessaire #}
{# ajouter ici l'event.aside_iframe_url au besoin #}
{# ajouter ici le chatBBB au besoin #}
</div>
</div>
{# ajouter ici l' event.iframe_url si nécessaire #}
{# ajouter ici l'event.iframe_url au besoin #}

<div id="divvideoonhold" style="display:none">
{# waiting video #}
Expand Down Expand Up @@ -146,11 +146,31 @@ <h2 class="video-title">{{ event.title }}</h2>
{% else %}
iframeplayer = videojs("podvideoplayer");
{% endif %}

iframeplayer.videoJsInfo();

let overlay = document.createElement("div");
overlay.id="overlay-footer";
document.getElementById("div-video-wrapper").appendChild(overlay);
iframeplayer.ready(function () {
const btinfo = document.querySelector(".vjs-info-button");
const clonedInfo = btinfo.cloneNode(true);
overlay.appendChild(clonedInfo);
clonedInfo.addEventListener("click", showInfoVideo);
});
document.querySelector("#info-video-wrapper .close").addEventListener("click", showInfoVideo);

iframeplayer.on('play',function() {
isPlaying = true;
document.getElementById("div-video-wrapper").className = '';
});
iframeplayer.on('pause',function() { isPlaying = false; });

</script>
{% endif %}

{% endblock more_script %}
{% if TRACKING_TEMPLATE %}{% include TRACKING_TEMPLATE %}{% endif %}
{% endblock page_content %}
</body>
</html>
</html>
10 changes: 4 additions & 6 deletions pod/live/templates/live/event_card.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@
<div class="card-header">
<div class="d-flex justify-content-end align-items-center">
<span class="text-muted small d-flex">
<span>
{% if event.is_current %}
{% if event.is_current %}
<span data-toggle="tooltip" title="{% trans 'Current event' %}">
<i class="bi bi-soundwave current_event" aria-hidden="true"></i>
{% else %}
<i class="bi bi-soundwave" aria-hidden="true"></i>
{% endif %}
</span>
</span>
{% endif %}
<span data-toggle="tooltip" title="{{event.broadcaster.name}}">
<i class="bi bi-info-circle" aria-hidden="true"></i>
</span>
Expand Down
4 changes: 4 additions & 0 deletions pod/locale/fr/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -3479,6 +3479,10 @@ msgstr "Éditer l’évènement"
msgid "Delete the event"
msgstr "Supprimer l’évènement"

#: pod/live/templates/live/event_card.html
msgid "Current event"
msgstr "Évènement en cours"

#: pod/live/templates/live/event_card.html pod/video/templates/videos/card.html
msgid "This content is in draft."
msgstr "Ce contenu est en mode brouillon."
Expand Down
10 changes: 9 additions & 1 deletion pod/locale/fr/LC_MESSAGES/djangojs.po
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Esup-Pod\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-11-06 15:50+0000\n"
"POT-Creation-Date: 2023-11-07 10:52+0000\n"
"PO-Revision-Date: \n"
"Last-Translator: ptitloup <nicolas.can@univ-lille.fr>\n"
"Language-Team: \n"
Expand Down Expand Up @@ -481,6 +481,14 @@ msgstr ""
"Cette extension de fichier n’est pas présente dans les extensions "
"autorisées :"

#: pod/main/static/js/videojs-info-controlbar.js
msgid "Info"
msgstr "Info"

#: pod/main/static/js/videojs-info-controlbar.js
msgid "Information"
msgstr "Information"

#: pod/playlist/static/playlist/js/add-or-edit.js
msgid "<b>Public:</b> the playlist can be accessed by anyone."
msgstr "<b>Public :</b> la liste de lecture est accessible par tous."
Expand Down
6 changes: 5 additions & 1 deletion pod/locale/nl/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Pod\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-11-06 15:50+0000\n"
"POT-Creation-Date: 2023-11-09 10:23+0000\n"
"PO-Revision-Date: 2023-06-08 14:37+0200\n"
"Last-Translator: obado <bado@unice.fr>\n"
"Language-Team: \n"
Expand Down Expand Up @@ -3260,6 +3260,10 @@ msgstr ""
msgid "Delete the event"
msgstr ""

#: pod/live/templates/live/event_card.html
msgid "Current event"
msgstr ""

#: pod/live/templates/live/event_card.html pod/video/templates/videos/card.html
msgid "This content is in draft."
msgstr ""
Expand Down
10 changes: 9 additions & 1 deletion pod/locale/nl/LC_MESSAGES/djangojs.po
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Esup-Pod\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-11-06 15:50+0000\n"
"POT-Creation-Date: 2023-11-07 10:52+0000\n"
"PO-Revision-Date: 2023-02-08 15:22+0100\n"
"Last-Translator: obado <bado@unice.fr>\n"
"Language-Team: \n"
Expand Down Expand Up @@ -457,6 +457,14 @@ msgstr ""
msgid "The file extension not in the allowed extension:"
msgstr ""

#: pod/main/static/js/videojs-info-controlbar.js
msgid "Info"
msgstr ""

#: pod/main/static/js/videojs-info-controlbar.js
msgid "Information"
msgstr ""

#: pod/playlist/static/playlist/js/add-or-edit.js
msgid "<b>Public:</b> the playlist can be accessed by anyone."
msgstr ""
Expand Down
Loading

0 comments on commit 945079f

Please sign in to comment.