diff --git a/comty.js b/comty.js index f408866a..94c8d738 160000 --- a/comty.js +++ b/comty.js @@ -1 +1 @@ -Subproject commit f408866ac27f7eb0ce2dd6abe1cfe4b1902cd7e8 +Subproject commit 94c8d7383e84a2de4b193d27adfcb1baa4163f68 diff --git a/linebridge b/linebridge index bc9b82da..fa61273d 160000 --- a/linebridge +++ b/linebridge @@ -1 +1 @@ -Subproject commit bc9b82dab1767b2fa1085fcf22336c455a7f89c1 +Subproject commit fa61273d5b4b40a22d97c7773321d8ca6c985fd7 diff --git a/packages/app/package.json b/packages/app/package.json index 5f9de4f3..fe225cb5 100755 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -1,6 +1,6 @@ { "name": "@comty/app", - "version": "1.40.0@alpha", + "version": "1.41.0@alpha", "license": "ComtyLicense", "main": "electron/main", "type": "module", @@ -33,7 +33,7 @@ "axios": "^1.7.7", "bear-react-carousel": "^4.0.10-alpha.0", "classnames": "2.3.1", - "comty.js": "^0.65.0", + "comty.js": "^0.65.5", "d3": "^7.9.0", "dashjs": "^5.0.0", "dompurify": "^3.0.0", diff --git a/packages/app/src/classes/ChunkedUpload/index.js b/packages/app/src/classes/ChunkedUpload/index.js index 5e93c5ab..22cc95cb 100644 --- a/packages/app/src/classes/ChunkedUpload/index.js +++ b/packages/app/src/classes/ChunkedUpload/index.js @@ -195,9 +195,11 @@ export default class ChunkedUpload { } waitOnSSE(data) { - console.log(`[UPLOADER] Connecting to SSE channel >`, data.sseUrl) + // temporal solution until comty.js manages this + const url = `${app.cores.api.client().mainOrigin}/upload/sse_events/${data.sseChannelId}` - const eventSource = new EventSource(data.sseUrl) + console.log(`[UPLOADER] Connecting to SSE channel >`, url) + const eventSource = new EventSource(url) eventSource.onerror = (error) => { this.events.emit("error", error) diff --git a/packages/app/src/pages/studio/tv/[profile_id]/components/StreamPreview/index.jsx b/packages/app/src/pages/studio/tv/[profile_id]/components/StreamPreview/index.jsx new file mode 100644 index 00000000..a90bcb94 --- /dev/null +++ b/packages/app/src/pages/studio/tv/[profile_id]/components/StreamPreview/index.jsx @@ -0,0 +1,44 @@ +import React from "react" +import Hls from "hls.js" + +const StreamPreview = ({ profile }) => { + const videoRef = React.useRef(null) + const hlsInstance = React.useRef(null) + + React.useEffect(() => { + hlsInstance.current = new Hls({ + maxLiveSyncPlaybackRate: 1.5, + strategy: "bandwidth", + autoplay: true, + }) + + hlsInstance.current.attachMedia(videoRef.current) + + hlsInstance.current.on(Hls.Events.MEDIA_ATTACHED, () => { + hlsInstance.current.loadSource(profile.sources.hls) + }) + + videoRef.current.addEventListener("play", () => { + console.log("[HLS] Syncing to last position") + videoRef.current.currentTime = hlsInstance.current.liveSyncPosition + }) + + videoRef.current.play() + + return () => { + hlsInstance.current.destroy() + } + }, []) + + return ( +