Jump to content

Ario.Paxaz

uniGUI Subscriber
  • Posts

    315
  • Joined

  • Last visited

  • Days Won

    5

Posts posted by Ario.Paxaz

  1. Hi,

     

    Quote

    Did you forget to assign?

    thanks for your replay, But I had found this from DFM file and done it.

     

    <audio id="player" height="0px" src="files/beep-digital.mp3" style="display:none"></audio>
    <div>
      <video id="video" width="100%" height="100%" style="border: 1px solid gray"></video>
    </div>
    
    <div id="sourceSelectPanel" style="display:none">
      <label for="sourceSelect">Change video source:</label>
      <select id="sourceSelect" style="max-width:400px">
      </select>
    </div>

     

    StringHtml.jpg

  2. I try it ,But Has this Error.

    O1F._ael=document.getElementById("player");O1F._ael.load();O1F.oldResultText="";let selectedDeviceId;    const codeReader = new ZXing.BrowserMultiFormatReader();    codeReader.getVideoInputDevices()      .then((videoInputDevices) => {        const sourceSelect = document.getElementById("sourceSelect");        selectedDeviceId = videoInputDevices[0].deviceId;        if (videoInputDevices.length >= 1) {          videoInputDevices.forEach((element) => {            const sourceOption = document.createElement("option");            sourceOption.text = element.label;            sourceOption.value = element.deviceId;            sourceSelect.appendChild(sourceOption);          });          sourceSelect.onchange = () => {            selectedDeviceId = sourceSelect.value;          };          const sourceSelectPanel = document.getElementById("sourceSelectPanel");          sourceSelectPanel.style.display = "block";        }        document.getElementById("O17_id").addEventListener("click", () => {          codeReader.decodeFromVideoDevice(selectedDeviceId, "video", (result, err) => {            if (result&&result.text!=O1F.oldResultText) {              window.ajaxRequest(O1F, "getResult", ["result="+result.text]);O1F.oldResultText=result.text;            }            if (err && !(err instanceof ZXing.NotFoundException)) {            }          });        });        document.getElementById("O1B_id").addEventListener("click", () => {          codeReader.reset();          ajaxRequest(O1F, "getResult", ["result="+""]);        })      })      .catch((err) => {        alert(err)      });

    Regards.

    Error1.jpg

×
×
  • Create New...