YouTube

YouTube వీడియో URL లేదా వీడియో IDని స్వీకరించి ఎంబెడ్ బ్లాక్‌గా మారుస్తుంది. పత్రం పూర్తి URLని కాకుండా 11 అక్షరాల వీడియో ID, వెడల్పునే నిల్వ చేస్తుంది; కొత్త వీడియో 70% వెడల్పుతో మధ్యలో ప్రారంభమవుతుంది.

వెడల్పును నిర్ణీత దశలలో ఎంచుకుంటారు; సమలేఖనం వీడియోను చుట్టిన పేరాలో నిల్వ అవుతుంది. ఎడిటర్‌లో మొదటి క్లిక్ వీడియోను ఎంచుతుంది; ఎంచుకున్న తర్వాత మళ్లీ క్లిక్ చేస్తే ప్లే చేయవచ్చు. చిరునామా మార్చాలంటే వీడియోను తొలగించి కొత్తదాన్ని చేర్చండి.

వింగ్స్
ప్రాథమిక అక్షరరూపంఆఫ్‌సెట్
HTMLఎడిటర్ లోడ్ అవుతోంది…
JSONnabi-treeఎడిటర్ లోడ్ అవుతోంది…
ఇన్‌స్టాల్
npm install nabi-note
కోడ్
import {
  createNabiWith, mountSurface, mountToolbar, mountContextToolbar,
  mountHints, watchSettle, codeWing, imageWing, youtubeWing,
  mountViewTools,
} from 'nabi-note'

const selected = [
  codeWing,
  imageWing,
  youtubeWing,
]
const { nabi, registry } = createNabiWith(selected)

// Bring your own highlighter (Prism, highlight.js, Shiki, …) — the wing stays as it is
// and only the attach is swapped (`makeCodeAttach` ships from the same door)
// { ...codeWing, attach: makeCodeAttach({ highlight: (source, lang) => [{ text: source }] }) }

const root = document.querySelector('.nabi')!
const content = document.querySelector('.nabi-content')!

// The locale also sets the direction — Arabic and Urdu run right to left
mountSurface({ nabi, registry, root: content, locale: 'te' })

const settle = watchSettle(document, { surface: content })
const shared = { nabi, registry, surface: content, settle, locale: 'te' }
const toolbar = mountToolbar({ ...shared, root: document.querySelector('#toolbar')! })
const context = mountContextToolbar({ ...shared, root: document.querySelector('#context')! })
mountHints({ toolbar, context, root, surface: content })
// The preview and fullscreen buttons — they stand their own box at the end of the row
mountViewTools({ ...shared, root, container: document.querySelector('#toolbar')! })

// on every change — hook up your own code here
// nabi.onChange(() => user_callback(nabi.getHtml()))
ts
const selected = wings().use('youtube').build()

CSS శైలులు

వీడియో అంచు లేదా మూలలను మార్చడానికి .nabi-content iframe వాడండి. నిల్వ చేసిన వెడల్పు లేదా సమలేఖనాన్ని మార్చవద్దు.

css
.article-body iframe {
  border-radius: 14px;
  box-shadow: 0 10px 28px rgb(0 0 0 / 16%);
}

ప్యాకేజీ వీడియో పరిమాణాన్ని సరిగ్గా ఉంచడానికి aspect-ratio, వెడల్పు, సమలేఖన మార్జిన్‌లను వాడుతుంది; వాటిని ఓవర్‌రైడ్ చేయవద్దు.