Skip to content

Commit 155c091

Browse files
committed
Major updates to the SDK workflow
Signed-off-by: Fabien Lavocat <[email protected]>
1 parent 01455bd commit 155c091

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+1644
-2730
lines changed

package-lock.json

Lines changed: 209 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,6 @@
8383
"eslint-plugin-promise": "^6.6.0",
8484
"husky": "^4.3.8",
8585
"install": "^0.13.0",
86-
"jest": "^29.4.1",
87-
"jest-cucumber": "^3.0.1",
88-
"jest-environment-jsdom": "^29.7.0",
89-
"jest-environment-node": "^29.4.1",
90-
"jest-puppeteer": "^9.0.1",
91-
"jest-websocket-mock": "^2.2.0",
9286
"jsdom": "~22.1.0",
9387
"lint-staged": "^10.5.4",
9488
"mock-socket": "^9.0.3",

packages/millicast-chromecast-receiver/src/viewer.ts

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import { View, Director, Logger } from '@nx-millicast/millicast-sdk'
1+
import { Viewer, Director, Logger, LayersEventPayload } from '@nx-millicast/millicast-sdk'
22
import { DirectorSubscriberOptions } from 'packages/millicast-sdk/src/types/Director.types'
33

44
window.Logger = Logger
55

66
if (import.meta.env.MILLICAST_DIRECTOR_ENDPOINT) {
7-
Director.setEndpoint(import.meta.env.MILLICAST_DIRECTOR_ENDPOINT)
7+
Director.endpoint = import.meta.env.MILLICAST_DIRECTOR_ENDPOINT
88
}
99

1010
const addStream = (stream) => {
@@ -20,21 +20,19 @@ const removeStream = () => {
2020
}
2121

2222
const subscribe = async (streamName, streamAccountId) => {
23-
const options: DirectorSubscriberOptions = { streamName, streamAccountId }
24-
const tokenGenerator = () => Director.getSubscriber(options)
25-
const millicastView = new View(tokenGenerator)
26-
millicastView.on('broadcastEvent', (event) => {
27-
const layers = event.data.layers !== null ? event.data.layers : {}
28-
if (event.name === 'layers' && Object.keys(layers).length <= 0) {
29-
// call play logic or being reconnect interval
30-
close().then(() => {
31-
subscribe(streamName, streamAccountId)
32-
})
33-
console.error('Feed no longer found.')
34-
}
35-
})
23+
const millicastView = new Viewer({ streamName, streamAccountId })
24+
// millicastView.on('layers', (event: LayersEventPayload) => {
25+
// const layers = event.layers !== null ? event.layers : {}
26+
// if (Object.keys(layers).length <= 0) {
27+
// // call play logic or being reconnect interval
28+
// close().then(() => {
29+
// subscribe(streamName, streamAccountId)
30+
// })
31+
// console.error('Feed no longer found.')
32+
// }
33+
// })
3634

37-
millicastView.on('newTrack', (event) => {
35+
millicastView.on('track', (event) => {
3836
addStream(event.streams[0])
3937
})
4038

0 commit comments

Comments
 (0)