File size: 1,239 Bytes
f16bb9f
 
 
 
 
 
 
 
 
 
 
 
 
257d039
 
 
 
 
 
 
 
 
 
 
 
f16bb9f
 
 
 
 
cac01bb
 
 
 
 
f16bb9f
257d039
 
 
 
 
 
 
f16bb9f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
"""
File: video.py
Author: Dmitry Ryumin, Maxim Markitantov, Elena Ryumina, Anastasia Dvoynikova, and Alexey Karpov
Description: Event handler for Gradio app to video.
License: MIT License
"""

import gradio as gr

# Importing necessary components for the Gradio app
from app.config import config_data


def event_handler_video(video: str) -> tuple[
    gr.Button,
    gr.Button,
    gr.Textbox,
    gr.Plot,
    gr.Plot,
    gr.Plot,
    gr.Plot,
    gr.Row,
    gr.Textbox,
    gr.Textbox,
]:
    is_video_valid = bool(video)

    return (
        gr.Button(interactive=is_video_valid),
        gr.Button(interactive=is_video_valid),
        gr.Textbox(
            value=config_data.InformationMessages_NOTI_RESULTS[int(is_video_valid)],
            info=None,
            container=False,
            elem_classes="noti-results-" + str(is_video_valid).lower(),
        ),
        gr.Plot(value=None, visible=False),
        gr.Plot(value=None, visible=False),
        gr.Plot(value=None, visible=False),
        gr.Plot(value=None, visible=False),
        gr.Row(visible=False),
        gr.Textbox(value=None, info=None, container=False, visible=False),
        gr.Textbox(value=None, info=None, container=False, visible=False),
    )