Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

duplicate if #140

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 9 additions & 11 deletions src/components/app-video.vue
Original file line number Diff line number Diff line change
Expand Up @@ -84,18 +84,16 @@ export default {

const video = this.$refs.video
log('connectStreamToVideoElement', stream, video)
if (stream) {
if ('srcObject' in video)
video.srcObject = stream
else
video.src = window.URL.createObjectURL(stream) // for older browsers
if ('srcObject' in video)
video.srcObject = stream
else
video.src = window.URL.createObjectURL(stream) // for older browsers

// Keep in mind https://developers.google.com/web/updates/2017/09/autoplay-policy-changes
// But if the user allows to access camera it should be fine
// https://developer.mozilla.org/en-US/docs/Web/Media/Autoplay_guide
video.onloadedmetadata = () => this.playVideo(video)
video.onloadeddata = () => this.playVideo(video)
}
// Keep in mind https://developers.google.com/web/updates/2017/09/autoplay-policy-changes
// But if the user allows to access camera it should be fine
// https://developer.mozilla.org/en-US/docs/Web/Media/Autoplay_guide
video.onloadedmetadata = () => this.playVideo(video)
video.onloadeddata = () => this.playVideo(video)
}
catch (err) {
trackSilentException(err)
Expand Down