@streamscloud/embeddable 2.9.0 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/graphql.d.ts +1 -1
- package/dist/core/graphql.js +3 -2
- package/dist/short-videos/short-videos-player/cmp.short-videos-player.svelte +1 -1
- package/dist/short-videos/short-videos-player/index.js +2 -1
- package/dist/short-videos/short-videos-player/types.d.ts +2 -0
- package/dist/streams/stream-player/cmp.stream-player.svelte +2 -2
- package/dist/streams/stream-player/cmp.stream-player.svelte.d.ts +1 -0
- package/dist/streams/stream-player/index.d.ts +1 -0
- package/dist/streams/stream-player/index.js +2 -1
- package/dist/streams/stream-player/operations.graphql +2 -2
- package/package.json +1 -1
package/dist/core/graphql.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const createLocalGQLClient: (graphqlOrigin?: string, customFetch?: typeof fetch) => import("@urql/core").Client;
|
|
1
|
+
export declare const createLocalGQLClient: (graphqlOrigin?: string, headers?: HeadersInit, customFetch?: typeof fetch) => import("@urql/core").Client;
|
|
2
2
|
export declare const resolveGraphQLOrigin: (origin?: string) => string;
|
|
3
3
|
export declare const constructGraphQLUrl: (graphqlOrigin?: string) => string;
|
package/dist/core/graphql.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { createClient, fetchExchange } from '@urql/core';
|
|
2
|
-
export const createLocalGQLClient = (graphqlOrigin, customFetch) => createClient({
|
|
2
|
+
export const createLocalGQLClient = (graphqlOrigin, headers, customFetch) => createClient({
|
|
3
3
|
url: constructGraphQLUrl(resolveGraphQLOrigin(graphqlOrigin)),
|
|
4
4
|
requestPolicy: 'network-only',
|
|
5
5
|
fetchOptions: {
|
|
6
|
-
credentials: 'include'
|
|
6
|
+
credentials: 'include',
|
|
7
|
+
headers: headers
|
|
7
8
|
},
|
|
8
9
|
fetch: customFetch || fetch,
|
|
9
10
|
exchanges: [fetchExchange]
|
|
@@ -35,7 +35,7 @@ const initBuffer = (input) => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
35
35
|
var _a, _b;
|
|
36
36
|
try {
|
|
37
37
|
const { graphqlOrigin, ids, initialId } = input;
|
|
38
|
-
const graphql = createLocalGQLClient(graphqlOrigin);
|
|
38
|
+
const graphql = createLocalGQLClient(graphqlOrigin, { 'x-initiator': input.initiator || 'player/short-videos' });
|
|
39
39
|
const payload = yield graphql
|
|
40
40
|
.query(GetShortVideosDocument, {
|
|
41
41
|
input: {
|
|
@@ -11,6 +11,7 @@ export type IdsPlayerInput = {
|
|
|
11
11
|
ids: string[];
|
|
12
12
|
initialId?: string;
|
|
13
13
|
graphqlOrigin?: string;
|
|
14
|
+
initiator?: string;
|
|
14
15
|
};
|
|
15
16
|
export type OpenShortVideosPlayerInit = ProviderInit | IdsInit;
|
|
16
17
|
type ProviderInit = {
|
|
@@ -25,6 +26,7 @@ type IdsInit = {
|
|
|
25
26
|
graphqlOrigin?: string;
|
|
26
27
|
initialId?: string;
|
|
27
28
|
localization?: IShortVideosPlayerLocalization | 'en' | 'no';
|
|
29
|
+
initiator?: string;
|
|
28
30
|
on?: {
|
|
29
31
|
playerClosed?: () => void;
|
|
30
32
|
};
|
|
@@ -27,7 +27,7 @@ import { StreamPlayerLocalization } from './stream-player-localization';
|
|
|
27
27
|
import { StreamPlayerUiManager } from './ui-manager.svelte';
|
|
28
28
|
import { AppEventsTracker } from '@streamscloud/streams-analytics-collector';
|
|
29
29
|
import { onMount } from 'svelte';
|
|
30
|
-
let { streamId, graphqlOrigin, localization: localizationInit, showStreamsCloudWatermark, on } = $props();
|
|
30
|
+
let { streamId, graphqlOrigin, localization: localizationInit, showStreamsCloudWatermark, initiator, on } = $props();
|
|
31
31
|
const localization = $derived(new StreamPlayerLocalization(localizationInit));
|
|
32
32
|
let model = $state(null);
|
|
33
33
|
let buffer = $state.raw(null);
|
|
@@ -56,7 +56,7 @@ onMount(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
56
56
|
var _a, _b, _c, _d;
|
|
57
57
|
uiManager.overviewCollapsed = window && window.innerWidth < window.innerHeight;
|
|
58
58
|
try {
|
|
59
|
-
const graphql = createLocalGQLClient(graphqlOrigin);
|
|
59
|
+
const graphql = createLocalGQLClient(graphqlOrigin, { 'x-initiator': initiator !== null && initiator !== void 0 ? initiator : 'player/stream' });
|
|
60
60
|
const streamPayload = yield graphql.query(GetStreamDocument, { id: streamId }).toPromise();
|
|
61
61
|
if (!((_a = streamPayload.data) === null || _a === void 0 ? void 0 : _a.stream)) {
|
|
62
62
|
toastrWarning(localization.streamNotFound);
|
|
@@ -27,7 +27,7 @@ import { mount, unmount } from 'svelte';
|
|
|
27
27
|
* ```
|
|
28
28
|
*/
|
|
29
29
|
export const openStreamPlayer = (init) => {
|
|
30
|
-
const { streamId, graphqlOrigin, localization, showStreamsCloudWatermark } = init;
|
|
30
|
+
const { streamId, graphqlOrigin, localization, showStreamsCloudWatermark, initiator } = init;
|
|
31
31
|
const shadowHost = new ShadowHost();
|
|
32
32
|
const mounted = mount(StreamPlayer, {
|
|
33
33
|
target: shadowHost.shadowRoot,
|
|
@@ -36,6 +36,7 @@ export const openStreamPlayer = (init) => {
|
|
|
36
36
|
graphqlOrigin,
|
|
37
37
|
localization: getLocale(localization),
|
|
38
38
|
showStreamsCloudWatermark,
|
|
39
|
+
initiator,
|
|
39
40
|
on: {
|
|
40
41
|
streamActivated: (data) => {
|
|
41
42
|
AppEventsTracker.setOrganizationId(data.ownerId);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
query GetStream($id: String!) {
|
|
2
|
-
stream:embedStream(input: { id: $id }) {
|
|
2
|
+
stream: embedStream(input: { id: $id }) {
|
|
3
3
|
...StreamPlayerPayloadFragment
|
|
4
4
|
}
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
# noinspection GraphQLSchemaValidation
|
|
8
8
|
query GetStreamPages($input: EmbedStreamPagesInput!, $image_scale: ImageScale!) {
|
|
9
|
-
streamPages:embedStreamPages(input: $input) {
|
|
9
|
+
streamPages: embedStreamPages(input: $input) {
|
|
10
10
|
items {
|
|
11
11
|
...StreamPageViewerPayloadFragment
|
|
12
12
|
}
|