דף הבית
אקראי
כניסה לחשבון
הגדרות
אודות חב"דפדיה
חב"דפדיה
חיפוש
עריכת הדף "
יחידה:EmbedMedia
"
אזהרה:
אינכם מחוברים לחשבון. כתובת ה־IP שלכם תוצג בפומבי אם תבצעו עריכות כלשהן. אם
תיכנסו לחשבון
או
תיצרו חשבון
, העריכות שלכם תיוחסנה לשם המשתמש שלכם ותקבלו גם יתרונות אחרים.
בדיקת אנטי־ספאם.
אין
למלא שדה זה!
local p = {} function p.embed(frame) local url = frame.args.url or frame.args[1] local width = frame.args.width or "100%" local height = frame.args.height or "360" local autoplay = frame.args.autoplay == "true" and "autoplay" or "" local loop = frame.args.loop == "true" and "loop" or "" local muted = frame.args.muted == "true" and "muted" or "" if not url or url == "" then return '<span style="color:red;">שגיאה: לא סופק קישור למדיה</span>' end -- YouTube local yt_id = url:match("v=([%w%-_]+)") or url:match("youtu%.be/([%w%-_]+)") if yt_id then local embed_url = "https://www.youtube.com/embed/"..yt_id return string.format('<iframe width="%s" height="%s" src="%s" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>', width, height, embed_url) end -- Vimeo local vimeo_id = url:match("vimeo.com/(%d+)") if vimeo_id then local embed_url = "https://player.vimeo.com/video/"..vimeo_id return string.format('<iframe width="%s" height="%s" src="%s" frameborder="0" allow="autoplay; fullscreen; picture-in-picture" allowfullscreen></iframe>', width, height, embed_url) end -- MP4 if url:match("%.mp4$") then return string.format('<video width="%s" height="%s" controls %s %s %s><source src="%s" type="video/mp4">דפדפן זה אינו תומך בהטמעת וידאו.</video>', width, height, autoplay, loop, muted, url) end -- MP3 if url:match("%.mp3$") then return string.format('<audio controls %s %s %s><source src="%s" type="audio/mpeg">דפדפן זה אינו תומך בהטמעת שמע.</audio>', autoplay, loop, muted, url) end -- SoundCloud (צריך iframe) if url:match("soundcloud.com") then return string.format('<iframe width="%s" height="166" scrolling="no" frameborder="no" allow="autoplay" src="https://w.soundcloud.com/player/?url=%s"></iframe>', width, url) end return '<span style="color:red;">שגיאה: סוג מדיה לא נתמך</span>' end return p
תקציר
?
לתשומת ליבך: תרומתך לאתר חב"דפדיה תפורסם לפי תנאי הרישיון GNU Free Documentation License 1.2 (אפשר לעיין בדף
חב"דפדיה:זכויות יוצרים
לפרטים נוספים). אם אינך רוצה שעבודתך תהיה זמינה לעריכה על־ידי אחרים, שתופץ לעיני כול, ושאחרים יוכלו להעתיק ממנה תוך ציון המקור – אין לפרסם אותה פה.
כמו־כן, שמירת העריכה משמעה הבטחה שכתבת את הטקסט הזה בעצמך או העתקת אותו ממקור בנחלת הכלל (שאינו מוגבל בזכויות יוצרים) או מקור חופשי דומה.
אין לשלוח חומר מוגבל בזכויות יוצרים ללא רשות!
ביטול
עזרה בעריכה
(נפתח בחלון חדש)
הדף הבא מוכלל בדף זה:
יחידה:EmbedMedia/תיעוד
(
עריכה
)