Skip to content

Commit

Permalink
feat: move functions to render-html
Browse files Browse the repository at this point in the history
  • Loading branch information
kmaxxo committed Oct 5, 2023
1 parent aad45a0 commit 0b6f143
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@ export enum AudioEnvironments {
Sandbox = "sandbox",
}

export const CneAudioEnvironments = {
[AudioEnvironments.Production]: `https://embed-audio.cnevids.com`,
[AudioEnvironments.Sandbox]: `https://embed-audio-sandbox.cnevids.com`,
};

export class CneAudioEmbed extends BlockAnnotation<{
audioEnv: AudioEnvironments;
audioType: string;
Expand Down
7 changes: 6 additions & 1 deletion packages/@atjson/renderer-html/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
Section,
TikTokEmbed,
CneAudioEmbed,
CneAudioEnvironments,
AudioEnvironments,
} from "@atjson/offset-annotations";
import { Mark, Block } from "@atjson/document";
import Renderer from "@atjson/renderer-hir";
Expand Down Expand Up @@ -262,6 +262,11 @@ export default class HTMLRenderer extends Renderer {

// CNE Audio embed
*CneAudioEmbed(embed: Block<CneAudioEmbed>) {
const CneAudioEnvironments = {
[AudioEnvironments.Production]: `https://embed-audio.cnevids.com`,
[AudioEnvironments.Sandbox]: `https://embed-audio-sandbox.cnevids.com`,
};

return yield* this.$("iframe", {
id: embed.attributes.anchorName,
src: `${CneAudioEnvironments[embed.attributes.audioEnv]}/iframe/${
Expand Down

0 comments on commit 0b6f143

Please sign in to comment.