我正在嘗試使用 Primeface 的 PhotoCam(版本 6.2),并且使用他們展示中的示例,該相機在 Firefox(開發(fā)人員版 63.0b13)或 Safari 版本 12 上對我不起作用......并且在 Safari 上不起作用移動設(shè)備(移動設(shè)備在 iOS12 上)。它被部署到一個帶有 https 的站點,并且可以在 Chrome 桌面和移動瀏覽器上運行。我現(xiàn)在正在使用展示演示,可以在這里找到(代碼也在下面發(fā)布):https://www.primefaces.org/showcase/ui/multimedia/photoCam.xhtml我什至下載了展示戰(zhàn)爭文件并嘗試了該版本,但沒有成功。有人可以幫忙嗎?發(fā)生了什么?在 Firefox 上:我收到允許訪問相機的提示,我單擊確定。我得到一個運行 Adobe Flash 的提示,我同意。接受兩者后,相機“盒子”只是白色的。當(dāng)我單擊“捕獲”時,收到的錯誤是“Webcam.js 錯誤:尚未加載網(wǎng)絡(luò)攝像頭”。注意:控制臺在頁面加載時返回“unreachable code after return statement[Learn More]”,但在接受這兩個提示后沒有顯示其他消息。在 Safari 上:我收到允許訪問相機的提示,我單擊確定。我收到錯誤“Webcam.js 錯誤:無法訪問網(wǎng)絡(luò)攝像頭:類型錯誤:類型錯誤類型錯誤:類型錯誤”在移動設(shè)備上的 Safari 上:我收到錯誤“Webcam.js 錯誤:無法訪問網(wǎng)絡(luò)攝像頭:錯誤:約束無效錯誤:約束無效”這是xhtml:<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:p="http://primefaces.org/ui" template="/common/template.xhtml"><ui:define name="title">PhotoCam</ui:define><ui:define name="content"> <h:form> <h:panelGrid columns="3" cellpadding="5"> <p:photoCam widgetVar="pc" listener="#{photoCamView.oncapture}" update="photo"/> <p:commandButton type="button" value="Capture" onclick="PF('pc').capture()"/> <p:outputPanel id="photo"> <p:graphicImage name="demo/images/photocam/#{photoCamView.filename}.jpeg" rendered="#{not empty photoCamView.filename}"/> </p:outputPanel> </h:panelGrid> </h:form></ui:define>這是java類public class PhotoCamView {private String filename;private String getRandomImageName() { int i = (int) (Math.random() * 10000000); return String.valueOf(i);}public String getFilename() { return filename;}我很感激這方面的任何幫助。(我也在 Primefaces 論壇上發(fā)布了這個,希望這里或那里有人可以幫助我。當(dāng)我弄清楚這一點時,我會更新這兩個網(wǎng)站)
2 回答

侃侃爾雅
TA貢獻1801條經(jīng)驗 獲得超16個贊
我最近剛剛將 Photocam 更新到其 JS 插件的最新版本,并修復(fù)了 IE11 的類似錯誤??催@里:
https://github.com/primefaces/primefaces/issues/4094
https://github.com/primefaces/primefaces/issues/3755
我強烈建議您從 GitHub 嘗試 6.3-SNAPSHOT 版本的 PrimeFaces,并讓我們知道這個最新版本是否解決了您的問題。
添加回答
舉報
0/150
提交
取消