{"id":2603,"date":"2026-03-02T13:00:16","date_gmt":"2026-03-02T13:00:16","guid":{"rendered":"https:\/\/y-care.be\/?page_id=2603"},"modified":"2026-06-04T21:36:35","modified_gmt":"2026-06-04T21:36:35","slug":"video-call","status":"publish","type":"page","link":"https:\/\/y-care.be\/nl\/video-call\/","title":{"rendered":"Video Call"},"content":{"rendered":"<div class=\"et_pb_section_0 et_pb_section et_section_regular et_block_section\"><div class=\"et_pb_row_0 et_pb_row et_block_row\"><div class=\"et_pb_column_0 et_pb_column et_pb_column_4_4 et-last-child et_block_column et_pb_css_mix_blend_mode_passthrough\"><div class=\"et_pb_code_0 et_pb_code et_pb_module\"><div class=\"et_pb_code_inner\"><div id=\"video-call\" style=\"width:100%;max-width:900px;margin:auto;\"><\/div>\n\n<script src=\"https:\/\/download.agora.io\/sdk\/release\/AgoraRTC_N.js\"><\/script>\n\n<script>\nconst APP_ID = \"4674b4bccec54017814feab055cd33f4\";\nconst CHANNEL = \"ycare\";\n\nconst client = AgoraRTC.createClient({mode:\"rtc\",codec:\"vp8\"});\n\nasync function startVideo(){\n    await client.join(APP_ID, CHANNEL, null, null);\n\n    const videoTrack = await AgoraRTC.createCameraVideoTrack();\n    const audioTrack = await AgoraRTC.createMicrophoneAudioTrack();\n\n    await client.publish([videoTrack,audioTrack]);\n\n    videoTrack.play(\"video-call\");\n}\n\nstartVideo();\n<\/script><\/div><\/div><\/div><\/div><\/div><div class=\"et_pb_section_1 et_pb_section et_section_regular et_block_section\"><div class=\"et_pb_row_1 et_pb_row et_block_row\"><div class=\"et_pb_column_1 et_pb_column et_pb_column_4_4 et-last-child et_block_column et_pb_css_mix_blend_mode_passthrough\"><div class=\"et_pb_code_1 et_pb_code et_pb_module\"><div class=\"et_pb_code_inner\"><button id=\"start-call\">Start video call<\/button>\n\n<div id=\"video-container\" style=\"width:100%;height:500px;background:#000;\"><\/div>\n\n<script src=\"https:\/\/download.agora.io\/sdk\/release\/AgoraRTC_N.js\"><\/script>\n\n<script>\nconst APP_ID = \"4674b4bccec54017814feab055cd33f4\";\nconst CHANNEL = \"ycare\";\n\nconst client = AgoraRTC.createClient({mode:\"rtc\",codec:\"vp8\"});\n\ndocument.getElementById(\"start-call\").onclick = async () => {\n\nawait client.join(APP_ID, CHANNEL, null, null);\n\nconst stream = await AgoraRTC.createMicrophoneAndCameraTracks();\n\nawait client.publish(stream);\n\nstream[1].play(\"video-container\");\n\n};\n<\/script><\/div><\/div><\/div><\/div><\/div><div class=\"et_pb_section_2 et_pb_section et_section_regular et_block_section\"><div class=\"et_pb_row_2 et_pb_row et_block_row\"><div class=\"et_pb_column_2 et_pb_column et_pb_column_4_4 et-last-child et_block_column et_pb_css_mix_blend_mode_passthrough\"><div class=\"et_pb_code_2 et_pb_code et_pb_module\"><div class=\"et_pb_code_inner\"><div>\n<button id=\"join\">Start video call<\/button>\n<button id=\"leave\">Stop<\/button>\n<div id=\"local-player\" style=\"width:400px;height:300px;\"><\/div>\n<div id=\"remote-player\" style=\"width:400px;height:300px;\"><\/div>\n<\/div>\n\n<script src=\"https:\/\/download.agora.io\/sdk\/release\/AgoraRTC_N.js\"><\/script>\n\n<script>\nconst APP_ID = \"4674b4bccec54017814feab055cd33f4\";\nconst CHANNEL = \"ycare-video\";\n\nlet client;\nlet localTracks = [];\n\ndocument.getElementById(\"join\").onclick = async () => {\n\nclient = AgoraRTC.createClient({ mode: \"rtc\", codec: \"vp8\" });\n\nawait client.join(APP_ID, CHANNEL, null, null);\n\nlocalTracks = await AgoraRTC.createMicrophoneAndCameraTracks();\n\nlocalTracks[1].play(\"local-player\");\n\nawait client.publish(localTracks);\n\nclient.on(\"user-published\", async (user, mediaType) => {\n\nawait client.subscribe(user, mediaType);\n\nif (mediaType === \"video\") {\n\nuser.videoTrack.play(\"remote-player\");\n\n}\n\nif (mediaType === \"audio\") {\n\nuser.audioTrack.play();\n\n}\n\n});\n\n};\n\ndocument.getElementById(\"leave\").onclick = async () => {\n\nfor (track of localTracks) {\n\ntrack.stop();\ntrack.close();\n\n}\n\nawait client.leave();\n\n};\n<\/script><\/div><\/div><\/div><\/div><\/div>","protected":false},"excerpt":{"rendered":"","protected":false},"author":6,"featured_media":0,"parent":0,"menu_order":43,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"footnotes":""},"class_list":["post-2603","page","type-page","status-publish","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/y-care.be\/nl\/wp-json\/wp\/v2\/pages\/2603","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/y-care.be\/nl\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/y-care.be\/nl\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/y-care.be\/nl\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/y-care.be\/nl\/wp-json\/wp\/v2\/comments?post=2603"}],"version-history":[{"count":11,"href":"https:\/\/y-care.be\/nl\/wp-json\/wp\/v2\/pages\/2603\/revisions"}],"predecessor-version":[{"id":3194,"href":"https:\/\/y-care.be\/nl\/wp-json\/wp\/v2\/pages\/2603\/revisions\/3194"}],"wp:attachment":[{"href":"https:\/\/y-care.be\/nl\/wp-json\/wp\/v2\/media?parent=2603"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}