Horz/Vert distance constraint with modal workflow (#43)

* button style tweak

* Remove duplication constraint ast transforms

* giveSketchFnCallTag to return if line already had a tag

* remove duplication

* update tag name to referenceSegName

* Update transform shape to return key details about the transform

* add modal to hor vert distance workflow

* fix browser env stuff from breaking tests

* fmt
This commit is contained in:
Kurt Hutten
2023-03-07 15:45:59 +11:00
committed by GitHub
parent a0518c556f
commit 2ac24bcd95
16 changed files with 376 additions and 203 deletions

View File

@ -5,6 +5,11 @@ export const Stream = () => {
const videoRef = useRef<HTMLVideoElement>(null)
useEffect(() => {
if (
typeof window === 'undefined' ||
typeof RTCPeerConnection === 'undefined'
)
return
const url = 'wss://dev.api.kittycad.io/ws/channel'
const [pc, socket] = [new RTCPeerConnection(), new WebSocket(url)]
// Connection opened
@ -41,15 +46,15 @@ export const Stream = () => {
iceServers: message.ice_servers,
})
pc.ontrack = function (event) {
const el = document.createElement(
event.track.kind
) as HTMLVideoElement
if (videoRef.current) {
videoRef.current.srcObject = event.streams[0]
videoRef.current.autoplay = true
videoRef.current.controls = true
}
console.log('has element?', videoRef.current)
setTimeout(() => {
console.log('has element in timeout?', videoRef.current)
if (videoRef.current) {
videoRef.current.srcObject = event.streams[0]
videoRef.current.autoplay = true
videoRef.current.controls = true
}
})
}
pc.oniceconnectionstatechange = (e) =>
console.log(pc.iceConnectionState)