""" UI設定ファイル このファイルは以下の設定を定義しています: - 外カメラ強制設定 - フッター非表示CSS - ボタンラベル app.py を変更する際は、必ずこのファイルをインポートして使用すること。 直接 app.py 内で定義してはいけない。 【重要】FastRTC track_constraints の正しい形式: - "video" キーでラップしない(直接指定) - facingMode は文字列で指定("environment" or "user") - {"exact": ...} 形式は使わない 【重要】外カメラ映像の左右反転対応: - FastRTCはデフォルトでCSSミラーリングを適用している可能性がある - CSSで video { transform: none !important; } を指定してミラーリングを無効化 - 外カメラ(背面カメラ)はミラーリング不要(テキストが正しく読める必要がある) """ # 外カメラ強制設定(FastRTC形式) # facingMode: "environment" = 外カメラ(背面カメラ) # facingMode: "user" = 内カメラ(前面カメラ) # 注意: FastRTCではvideoキーでラップせず直接指定する TRACK_CONSTRAINTS = { "facingMode": "environment", "width": {"ideal": 1280}, "height": {"ideal": 720}, "frameRate": {"ideal": 15}, } # CSS設定 # - フッター非表示 # - ビデオミラーリング無効化(外カメラ用) CUSTOM_CSS = """ .gradio-container { max-width: 100% !important; padding: 0 !important; } footer { display: none !important; visibility: hidden !important; height: 0 !important; } .built-with { display: none !important; } .svelte-1rjryqp { display: none !important; } #footer { display: none !important; } .footer { display: none !important; } .gr-footer { display: none !important; } [class*="footer"] { display: none !important; } /* ビデオミラーリング無効化(外カメラはミラーリング不要) */ video { transform: none !important; -webkit-transform: none !important; } """ # ボタンラベル(日本語禁止) BUTTON_LABELS = { "start": "Start", "stop": "Stop", "waiting": "...", } # アイコンボタンの色 ICON_BUTTON_COLOR = "#4CAF50"