<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
<!DOCTYPE html>
<html lang="ko">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="Content-Type" content= "text/html; charset=UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="Content-Script-Type" content="text/javascript">
    <meta http-equiv="Content-Style-Type" content="text/css">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="format-detection" content="telephone=no">
    <link rel="favicon" href="/images/favicon.ico">
    <title>평택시 교통정보센터 - ${subTitle}</title>

    <!--Existing CSS-->
    <%--    <link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">--%>
    <%--    <link rel="stylesheet" type="text/css" href="/css_old/responsive.css" />--%>
    <%--    <link rel="stylesheet" type="text/css" href="/css_old/style.css" />--%>
    <!---->

    <!-- Bootstrap CSS -->

    <link href="/common/bootstrap-5.1.3-dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
    <link rel="stylesheet" type="text/css" href="/common/css/reset.css?v=20250526" />
    <link rel="stylesheet" type="text/css" href="/common/css/layout.css?v=20250528" />
    <link rel="stylesheet" type="text/css" href="/common/css/contents.css?v=20250526" />
    <link rel="stylesheet" type="text/css" href="/common/css/Exsting_style.css?v=20250526">
    <link rel="stylesheet" type="text/css" href="/common/css/jquery-ui-1.13.2.min.css">
    <script src="/js/jquery-3.7.0.min.js"></script>
    <script src="/js/jquery-ui-1.13.2.min.js"></script>
    <script type="text/javascript" src="/js/common.js?v=20250526"></script>
<%--    <script src="/js/HiVeWebRtcPlayer/webrtcadapter.js"></script>--%>
<%--    <script src="/js/HiVeWebRtcPlayer/HiVeWebRtcPlayer.js"></script>--%>
    <script type="text/javascript" src="/js/js_sdk/adapter.js"></script>
    <script type="text/javascript" src="/js/js_sdk/real_webrtc_lib.js" ></script>
    <script type="text/javascript" src="/js/js_sdk/real_webrtc_handler.js" ></script>
</head>
<body>
<div class="map_popup_cctv">
    <dl>
        <dt>
            <p class="lctn_nm">${cctv.istl_lctn_nm}</p>
            <p class="fr black restTime">남은 재생시간 : <span id="restTime">30</span>&nbsp;초&nbsp;</p>
            <a href="javascript:cctvClose('${cctv.cctv_mngm_nmbr}')" id="cctvClose" title="CCTV영상닫기"><img src="/images/cctv/xbtn.png" alt="CCTV영상닫기"/></a>
        </dt>
        <dl style="padding : 0 17px;">
            <div id="web-rtc-server" style="width:100%; height:100%; background: black;">
            </div>
        </dl>
    </dl>
</div>
<div id="dialog" class="selector ui-dialog-content ui-widget-content" style="width: auto; min-height: 0px; height: 116px; display:none;">
</div>
</body>
<script type="text/javascript">
    // if (document.location.protocol == 'http:') {
    //    document.location.href = document.location.href.replace('http:', 'https:');
    // }
    let WEB_RTC_SVR_IP   = "${cctv.web_rtc_svr_ip}";
    let WEB_RTC_SVR_PORT = "${cctv.web_rtc_svr_port}";
    let WEB_RTC_ID       = "${cctv.web_rtc_id}";
    let ICE_SERVER       = "${cctv.ice_server}";
    let ICE_SERVER_ID    = "${cctv.ice_server_id}";
    let ICE_SERVER_PWD   = "${cctv.ice_server_pswd}";

    // var webrtcPlayer1 = new HiVeWebRtcPlayer("11", WEB_RTC_SVR_IP, WEB_RTC_SVR_PORT, WEB_RTC_ID, true, false, 0, 0, 1, true);
    // openCCTV();
    webRtcConntect(ICE_SERVER, ICE_SERVER_ID, ICE_SERVER_PWD, WEB_RTC_ID, WEB_RTC_SVR_IP, WEB_RTC_SVR_PORT);
</script>
