{"id":8,"date":"2024-05-16T05:50:08","date_gmt":"2024-05-16T05:50:08","guid":{"rendered":"https:\/\/vicon.bsi.international\/?page_id=8"},"modified":"2024-09-21T04:18:09","modified_gmt":"2024-09-21T04:18:09","slug":"vicon-bsi-international","status":"publish","type":"page","link":"https:\/\/vicon2.bsi.international\/","title":{"rendered":"Vicon Bsi International"},"content":{"rendered":"\n<div class=\"pnm-container\">\n    <div class=\"column column-full\">\n        <div class=\"description\"><\/div>\n        <hr\/>\n\t\t\n<div class=\"column-full \">\n    <div class=\"flex\">\n        <div class=\"w-full\">\n            <form class=\"login-form plugnmeet-login-form\">\n                <div class=\"alert roomStatus\" role=\"alert\" style=\"display: none\"><\/div>\n                <label for=\"name\" class=\"input\">\n                    <span>Name<\/span>\n                    <input type=\"text\" name=\"name\" class=\"form-control form-field\" id=\"name\" required\n                           value=\"\"\n                           placeholder=\"Your full name\"\n                    >\n                <\/label>\n\n\t\t\t\t\n                <input type=\"hidden\" name=\"id\" value=\"1\">\n                <input type=\"hidden\" name=\"action\" value=\"plugnmeet_login_to_room\">\n                <input type=\"hidden\" name=\"current_url\" value=\"https%3A%2F%2Fvicon2.bsi.international%2Findex.php%3Frest_route%3D%252Fwp%252Fv2%252Fpages%252F8\">\n                <input type=\"hidden\" name=\"nonce\"\n                       value=\"583b104fbf\">\n                <div class=\"btns\">\n                    <button type=\"submit\" class=\"submit\">Join<\/button>\n                <\/div>\n            <\/form>\n        <\/div>\n    <\/div>\n<\/div>\n\n\t\t\t\t\t\n<div class=\"column-full recordings\">\n    <h1 class=\"headline\">Recordings<\/h1>\n    <div class=\"br\">\n        <div class=\"br-inner\"><\/div>\n    <\/div>\n    <div class=\"recording-table\">\n        <div class=\"table-inner\">\n            <div class=\"table-head\">\n                <div class=\"recording-date\">Recording date<\/div>\n                <div class=\"meeting-date\">Meeting date<\/div>\n                <div class=\"file-size\">File size (MB)<\/div>\n                <div class=\"action\"><\/div>\n            <\/div>\n            <div id=\"recordingListsBody\"><\/div>\n        <\/div>\n    <\/div>\n    <ul class=\"pagination\" style=\"display: none\">\n        <button id=\"backward\">Pre<\/button>\n        <button id=\"forward\">Next<\/button>\n    <\/ul>\n    <div id=\"playbackModal\" style=\"display:none\">\n        <video id=\"modalPlayer\" width=\"100%\" height=\"400\" controls controlsList=\"nodownload\" src=\"\"\n               oncontextmenu=\"return false\"><\/video>\n    <\/div>\n<\/div>\n\n<script>\n    const CAN_PLAY = 1;\n    const CAN_DOWNLOAD = 1;\n    const CAN_DELETE = 0;\n    const roomId = '80c39c2a-1b06-4a7c-8a3d-f38bd2e8c1d8';\n    let isShowingPagination = false,\n        totalRecordings = 0,\n        currentPage = 1,\n        limitPerPage = 10,\n        showPre = false,\n        showNext = true;\n\n    window.addEventListener('load', () => {\n        document.addEventListener('click', function (e) {\n            if (e.target.id === 'backward') {\n                e.preventDefault();\n                if (!showPre) {\n                    return;\n                }\n                currentPage--;\n                paginate(currentPage);\n            } else if (e.target.id === 'forward') {\n                e.preventDefault();\n                if (!showNext) {\n                    return;\n                }\n                currentPage++;\n                paginate(currentPage);\n            }\n        });\n\n        jQuery('body').on('thickbox:removed', function () {\n            document.getElementById(\"modalPlayer\").src = \"\";\n        });\n\n        fetchRecordings();\n    });\n\n    const fetchRecordings = async (from = 0, limitPerPage = 10) => {\n        const formData = new FormData();\n        formData.append('nonce', '33641afba9');\n        formData.append('action', 'plugnmeet_get_recordings');\n        formData.append('from', from);\n        formData.append('limit', limitPerPage);\n        formData.append('roomId', roomId);\n        formData.append('order_by', 'DESC');\n\n        const data = await sendRequest(formData);\n        if (!data) {\n            return;\n        }\n\n        if (!data.status) {\n            showMessage(data.msg);\n            return;\n        }\n\n        const recordings = data.result.recordings_list;\n        if (!recordings) {\n            showMessage('no recordings found');\n            return;\n        }\n        totalRecordings = data.result.total_recordings;\n        if (\n            totalRecordings > limitPerPage &&\n            !isShowingPagination\n        ) {\n            showPagination();\n            isShowingPagination = true;\n        }\n        displayRecordings(recordings);\n    }\n\n    const downloadRecording = async (e) => {\n        e.preventDefault();\n        const recordId = e.target.attributes.getNamedItem('data-recording').value;\n\n        const formData = new FormData();\n        formData.append('nonce', '8a77ac6bde');\n        formData.append('action', 'plugnmeet_download_recording');\n        formData.append('roomId', roomId);\n        formData.append('recordingId', recordId);\n\n        const res = await sendRequest(formData);\n        if (!res) {\n            return;\n        }\n\n        if (res.status) {\n            window.open(res.url, \"_blank\");\n        } else {\n            alert(res.msg);\n        }\n    }\n\n    const playRecording = async (e, i) => {\n        e.preventDefault();\n        const recordId = e.target.attributes.getNamedItem('data-recording').value;\n        const title = document.getElementById(\"r_creation_\" + i).innerHTML;\n\n        const formData = new FormData();\n        formData.append('nonce', '8a77ac6bde');\n        formData.append('action', 'plugnmeet_download_recording');\n        formData.append('roomId', roomId);\n        formData.append('recordingId', recordId);\n        formData.append('role', 'can_play');\n\n        const res = await sendRequest(formData);\n        if (!res) {\n            return;\n        }\n\n        if (res.status) {\n            const modalPlayer = document.getElementById(\"modalPlayer\");\n            modalPlayer.src = res.url;\n            tb_show(title, '#TB_inline?height=450&amp;inlineId=playbackModal');\n            setTimeout(() => {\n                modalPlayer.setAttribute('style', '');\n            }, 200);\n        } else {\n            alert(res.msg);\n        }\n    }\n\n    const deleteRecording = async (e) => {\n        e.preventDefault();\n\n        if (confirm('Are you sure to delete?') !== true) {\n            return;\n        }\n\n        const recordId = e.target.attributes.getNamedItem('data-recording').value;\n        const formData = new FormData();\n        formData.append('nonce', 'e463090b61');\n        formData.append('action', 'plugnmeet_delete_recording');\n        formData.append('roomId', roomId);\n        formData.append('recordingId', recordId);\n\n        const res = await sendRequest(formData);\n        if (!res) {\n            return;\n        }\n\n        if (res.status) {\n            alert(res.msg);\n            document.getElementById(recordId).remove();\n        } else {\n            alert(res.msg);\n        }\n    }\n\n    const displayRecordings = (recordings) => {\n        let html = '';\n        for (let i = 0; i < recordings.length; i++) {\n            const recording = recordings[i];\n            html += '<div class=\"table-item\" id=\"' + recording.record_id + '\">';\n            html +=\n                '<div class=\"recording-date\" id=\"r_creation_' + i + '\">' +\n                new Date(recording.creation_time * 1e3).toLocaleString() +\n                '<\/div>';\n            html +=\n                '<div class=\"meeting-date\">' +\n                new Date(recording.room_creation_time * 1e3).toLocaleString() +\n                '<\/div>';\n            html += '<div class=\"file-size\">' + recording.file_size + '<\/div>';\n\n            html += '<div class=\"action\">';\n            if (CAN_PLAY) {\n                html +=\n                    '<a href=\"#\" class=\"download\" data-recording=\"' +\n                    recording.record_id +\n                    '\" onclick=\"playRecording(event, ' + i + ')\">Play<\/a>';\n            }\n\n            if (CAN_DOWNLOAD) {\n                html +=\n                    '<a href=\"#\" class=\"download\" data-recording=\"' +\n                    recording.record_id +\n                    '\" onclick=\"downloadRecording(event)\">Download<\/a>';\n            }\n\n            if (CAN_DELETE) {\n                html +=\n                    '<a href=\"#\" class=\"delete\" data-recording=\"' +\n                    recording.record_id +\n                    '\" onclick=\"deleteRecording(event)\">Delete<\/a>';\n            }\n            html += '<\/div>';\n\n            html += '<\/div>';\n        }\n\n        document.getElementById('recordingListsBody').innerHTML = html;\n    }\n\n    const showPagination = () => {\n        currentPage = 1;\n        document.querySelector('.pagination').style.display = '';\n        paginate(currentPage);\n    }\n\n    const paginate = (currentPage) => {\n        document.getElementById('recordingListsBody').innerHTML = '';\n        const from = (currentPage - 1) * limitPerPage;\n\n        if (currentPage === 1) {\n            showPre = false;\n            document.getElementById('backward').setAttribute('disabled', 'disabled');\n        } else {\n            showPre = true;\n            document.getElementById('backward').removeAttribute('disabled');\n        }\n\n        if (currentPage >= totalRecordings \/ limitPerPage) {\n            showNext = false;\n            document.getElementById('forward').setAttribute('disabled', 'disabled');\n        } else {\n            showNext = true;\n            document.getElementById('forward').removeAttribute('disabled');\n        }\n\n        fetchRecordings(from, limitPerPage);\n    }\n\n    const showMessage = (msg) => {\n        document.getElementById('recordingListsBody').innerHTML = msg;\n    }\n\n    const sendRequest = async (formData) => {\n        const res = await fetch(plugnmeet_frontend.ajaxurl, {\n            method: 'POST',\n            body: formData\n        })\n\n        if (!res.ok) {\n            console.error(res.status, res.statusText);\n            alert(res.statusText);\n            return null;\n        }\n\n        try {\n            return await res.json();\n        } catch (e) {\n            console.error(e);\n            alert(e);\n        }\n\n        return null;\n    }\n<\/script>\n\t\t    <\/div>\n    <script>\n        \/\/ check if returned from conference\n        const params = new URLSearchParams(document.location.search);\n        if (params.has(\"pnm-returned\", \"true\")) {\n            \/\/ this will only work if link opened with window.open()\n            window.close();\n        }\n    <\/script>\n<\/div>\n\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-8","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/vicon2.bsi.international\/index.php?rest_route=\/wp\/v2\/pages\/8","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vicon2.bsi.international\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/vicon2.bsi.international\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/vicon2.bsi.international\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/vicon2.bsi.international\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=8"}],"version-history":[{"count":22,"href":"https:\/\/vicon2.bsi.international\/index.php?rest_route=\/wp\/v2\/pages\/8\/revisions"}],"predecessor-version":[{"id":133,"href":"https:\/\/vicon2.bsi.international\/index.php?rest_route=\/wp\/v2\/pages\/8\/revisions\/133"}],"wp:attachment":[{"href":"https:\/\/vicon2.bsi.international\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=8"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}