Skip to content

Commit

Permalink
updated variable name and fix cross origin error
Browse files Browse the repository at this point in the history
  • Loading branch information
disha1202 committed Jan 25, 2024
1 parent a489cc2 commit 96e3128
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ input CreateAdvertisementInput {
organizationId: ID!
startDate: Date!
type: String!
file: String!
mediaFile: String!
}

type CreateAdvertisementPayload {
Expand Down
4 changes: 2 additions & 2 deletions src/GraphQl/Mutations/mutations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ export const ADD_ADVERTISEMENT_MUTATION = gql`
type: $type
startDate: $startDate
endDate: $endDate
file: $file
mediaFile: $file
}
) {
_id
Expand All @@ -456,7 +456,7 @@ export const UPDATE_ADVERTISEMENT_MUTATION = gql`
input: {
_id: $id
name: $name
file: $file
mediaFile: $file
type: $type
startDate: $startDate
endDate: $endDate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ function advertisementEntry({
loop={true}
playsInline
data-testid="media"
crossOrigin="anonymous"
>
<source src={mediaUrl} type="video/mp4" />
</video>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,14 @@ function advertisementRegister({
/>
{formState.advertisementMedia && (
<div className={styles.preview} data-testid="mediaPreview">
{formState.advertisementMedia.includes('data:video') ? (
<video muted autoPlay={true} loop={true} playsInline>
{formState.advertisementMedia.includes('video') ? (
<video
muted
autoPlay={true}
loop={true}
playsInline
crossOrigin="anonymous"
>
<source
src={formState.advertisementMedia}
type="video/mp4"
Expand Down

0 comments on commit 96e3128

Please sign in to comment.