Skip to content
Draft
Show file tree
Hide file tree
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
448 changes: 246 additions & 202 deletions dist/millicast-vue-viewer-plugin.common.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/millicast-vue-viewer-plugin.common.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/millicast-vue-viewer-plugin.css

Large diffs are not rendered by default.

448 changes: 246 additions & 202 deletions dist/millicast-vue-viewer-plugin.umd.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/millicast-vue-viewer-plugin.umd.js.map

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions dist/millicast-vue-viewer-plugin.umd.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/millicast-vue-viewer-plugin.umd.min.js.map

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"README.md"
],
"dependencies": {
"@millicast/sdk": "0.3.0-RC-2",
"@millicast/sdk": "0.3.0-RC-4",
"bootstrap": "github:millicast/bootstrap#ml-viewer",
"bootstrap-icons": "github:millicast/icons#ml-viewer",
"can-autoplay": "^3.0.0",
Expand Down
1 change: 0 additions & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ export default {
startingQuality: this.paramsOptions?.startingQuality,
hideToast: this.paramsOptions?.hideToast,
mainLabel: this.paramsOptions?.mainLabel ?? 'Main',
drm: this.paramsOptions.drm ?? false,
forcePlayoutDelayMin: this.paramsOptions?.forcePlayoutDelayMin,
forcePlayoutDelayMax: this.paramsOptions?.forcePlayoutDelayMax,
metadata: this.paramsOptions?.metadata,
Expand Down
2 changes: 1 addition & 1 deletion src/components/VideoPlayerMedia.vue
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ export default {
await stopStream()
await nextTick()

initViewModule()
await initViewModule()
try {
await connectToStream()
setTimeout(() => {
Expand Down
6 changes: 3 additions & 3 deletions src/service/sdkManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ const pauseControlListener = () => {
}
// SDK VIEW MODULE INITIALIZATION

export const initViewModule = () => {
export const initViewModule = async () => {
//Expose Viewer version and SDK Logger into the console
window.Version = process.env.PACKAGE_VERSION
window.Logger = Logger
const accountId = params.getAccountId()
const streamName = params.getStreamName()
viewConnection.handleInitViewConnection(accountId, streamName)
await viewConnection.handleInitViewConnection(accountId, streamName)
setViewerEvents()
}

Expand Down Expand Up @@ -142,7 +142,7 @@ const configureDrm = (event) => {
}

const updateActiveBroadcastState = (event) => {
if (event.data.encryption && state.Params.viewer.drm) {
if (event.data.encryption) {
configureDrm(event)
}
sources.getTracks(event.data)
Expand Down
14 changes: 10 additions & 4 deletions src/service/utils/viewConnection.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const setPeerConnection = () => {
}
}

export const handleInitViewConnection = (accountId, streamName) => {
export const handleInitViewConnection = async (accountId, streamName) => {
if (!streamName || !accountId) {
throw new Error('Stream ID not provided.')
}
Expand All @@ -49,8 +49,7 @@ export const handleInitViewConnection = (accountId, streamName) => {
const subscriber = Director.getSubscriber(
streamName,
accountId,
state.Params.viewer.token,
state.Params.viewer.drm
state.Params.viewer.token
)
subscriber.catch((error) => {
const errorMessage = `${error}`
Expand All @@ -63,7 +62,14 @@ export const handleInitViewConnection = (accountId, streamName) => {
})
return subscriber
}

const subResp = await Director.getSubscriber(
streamName,
accountId,
state.Params.viewer.token
)
if (subResp.drmObject) {
commit('Params/setDrm', true)
}
const millicastView = new View(streamName, tokenGenerator)
window.millicastView = millicastView
window.__defineGetter__('peer', () => {
Expand Down
3 changes: 3 additions & 0 deletions src/store/modules/params.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,8 @@ export default {
setEnvironmentOptions(state, environment) {
state.environment = environment
},
setDrm(state, drm) {
state.viewer.drm = drm
},
},
}