-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbasic16.html
More file actions
318 lines (245 loc) · 11.1 KB
/
Copy pathbasic16.html
File metadata and controls
318 lines (245 loc) · 11.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
<!DOCTYPE html>
<html lang="ar" dir="rtl">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="أساسيات لغة ترميز النص الفائق اتش.تي.إم.إل | إنشاء عرض فيديو باستخدام iframe"/> <link rel="stylesheet" href="style.css">
<link rel="icon" type="image/x-icon" href="../favicon.png">
<title>HTMLVerse | الأساسيات</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Noto+Kufi+Arabic:wght@100..900&display=swap" rel="stylesheet">
</head>
<body>
<header>
<a class="red" href="./index.html#16">X</a>
<h1>أساسيات اتش.تي.إم.إل</h1>
</header>
<main>
<!-- BASIC 16 -->
<div class="box">
<div class="sub-title">
<h2>١٨. إنشاء عرض فيديو باستخدام iframe</h2>
<span class="hint">ورشة عمل</span>
<p>في هذه الورشة، ستستخدم عنصر <code class="br">iframe</code> لعرض فيديو.</p>
</div>
<section>
<h3>الخطوة الأولى :</h3>
<p>ابدأ بإنشاء عنصر <code class="br">h1</code> باستخدام النص "إطار iframe لعرض الفيديو".</p>
<h4>الكود :</h4>
<div class="sourcecode">
<pre><span>code <br></span><code>
<h1>إطار iframe لعرض الفيديو</h1>
</code></pre>
</div>
<h4>معاينة :</h4>
<div class="preview" role="presentation">
<h1>
إطار iframe لعرض الفيديو
</h1>
</div>
<br>
<h3>الخطوة الثانية :</h3>
<p>الآن، أنشئ عنصر <code class="br">iframe</code>. لا تضع أي شيء فيه بعد.</p>
<h4>الكود :</h4>
<div class="sourcecode">
<pre><span>code <br></span><code>
<h1>إطار iframe لعرض الفيديو</h1>
<iframe>
</iframe>
</code></pre>
</div>
<h4>معاينة :</h4>
<div class="preview" role="presentation">
<h1>
إطار iframe لعرض الفيديو
</h1>
<iframe>
</iframe>
</div>
<br>
<h3>الخطوة الثالثة :</h3>
<p>في الدرس الأول عن عنصر <code class="br">iframe</code>، تعلمت أنه عنصر مُستبدل تمامًا مثل <code class="br">img</code>. هذا يعني أنه يمكنه أيضًا استخدام خاصيتي العرض <code class="br">width</code> والارتفاع <code class="br">height</code> لتحديد طوله وعرضه.</p>
<p>اضبط عرض <code class="br">width</code> عنصر <code class="br">iframe</code> على <strong>560</strong> وارتفاع <code class="br">height</code> <strong>315</strong>.</p>
<h4>الكود :</h4>
<div class="sourcecode">
<pre><span>code <br></span><code>
<h1>إطار iframe لعرض الفيديو</h1>
<iframe width="560" height="315">
</iframe>
</code></pre>
</div>
<h4>معاينة :</h4>
<div class="preview" role="presentation">
<h1>
إطار iframe لعرض الفيديو
</h1>
<iframe width="560" height="315">
</iframe>
</div>
<br>
<h3>الخطوة الرابعة :</h3>
<p>يأخذ عنصر <code class="br">iframe</code> أيضًا سمة <code class="br">src</code> بقيمة تشير إلى عنوان <strong>URL</strong> أو مسار <em>path</em> المورد المراد عرضه.</p>
<p>
أضف سمة المصدر <code class="br">src</code> التالية :
<code class="long-code br">https://www.youtube.com/embed/I0_951_MPE0</code>
إلى عنصر <code class="br">iframe</code>.
</p>
<p>في هذه المرحلة، سيظهر الفيديو على الصفحة، ولكن هناك بعض السمات الإضافية <em>more attributes</em> التي تحتاج إلى إضافتها.</p>
<h4>الكود :</h4>
<div class="sourcecode">
<pre><span>code <br></span><code>
<h1>إطار iframe لعرض الفيديو</h1>
<iframe
width="560"
height="315"
src="https://www.youtube.com/embed/I0_951_MPE0"
>
</iframe>
</code></pre>
</div>
<h4>معاينة :</h4>
<div class="preview" role="presentation">
<h1>
إطار iframe لعرض الفيديو
</h1>
<iframe width="560" height="315" src="https://www.youtube.com/embed/I0_951_MPE0">
</iframe>
</div>
<br>
<h3>الخطوة الخامسة :</h3>
<p>إحدى السمات هي "السماح" <code class="br">allow</code>. وهي أشبه بقائمة أذونات <em>permission list</em> تُعلم المتصفح بالميزات <strong>features</strong> المسموح للإطار المضمن <code class="br">iframe</code> باستخدامها.</p>
<p>إليك مثال عنص <code class="br">iframe</code> مع سمة <code class="br">allow</code> :</p>
<div class="example-code">
<pre><span>Example Code<br></span><code>
<iframe
allow="accelerometer autoplay clipboard-write encrypted-media gyroscope picture-in-picture web-share"
></iframe>
</code></pre>
</div>
<p>أضف سمة "السماح" <code class="br">allow</code> مع قيم "مقياس التسارع" <code class="br">accelerometer</code> و"التشغيل التلقائي" <code class="br">autoplay</code> و"كتابة الحافظة" <code class="br">clipboard-write</code>.</p>
<p>يتيح مقياس التسارع <code class="br">accelerometer</code> للإطار المضمن <code class="br">iframe</code> استخدام مستشعرات الحركة <em>motion sensors</em> لاكتشاف أمور مثل إمالة الجهاز ودورانه <em>device tilting and rotation</em>. يتيح التشغيل التلقائي <code class="br">autoplay</code> بدء تشغيل الفيديو تلقائيًا <em>automatically</em>، بينما يتيح الكتابة بالحافظة <code class="br">clipboard-write</code> للإطار المضمن <code class="br">iframe</code> كتابة البيانات <em>data</em> إلى حافظة المستخدم <em>user’s clipboard</em>.</p>
<h4>الكود :</h4>
<div class="sourcecode">
<pre><span>code <br></span><code>
<h1>إطار iframe لعرض الفيديو</h1>
<iframe
width="560"
height="315"
src="https://www.youtube.com/embed/I0_951_MPE0"
allow="accelerometer autoplay clipboard-write"
>
</iframe>
</code></pre>
</div>
<h4>معاينة :</h4>
<div class="preview" role="presentation">
<h1>
إطار iframe لعرض الفيديو
</h1>
<iframe width="560" height="315"
src="https://www.youtube.com/embed/I0_951_MPE0"
allow="accelerometer autoplay clipboard-write"
>
</iframe>
</div>
<br>
<h3>الخطوة السادسة :</h3>
<p>أضف "الوسائط المشفرة" <code class="br">encrypted-media</code>، و"الجيروسكوب" <code class="br">gyroscope</code>، و"مشاركة الويب" <code class="br">web-share</code> إلى القيم <em>values</em> الموجودة في سمة <em>attribute</em> "السماح" <code class="br">allow</code>.</p>
<p>ستتيح هذه الإضافات الثلاثة استخدام ملحقات الوسائط المشفرة encrypted media extensions لحماية الفيديو، والسماح للإطار المضمّن iframe بالظهور في وضع "صورة داخل صورة" picture-in-picture mode عند الحاجة، ومشاركة محتوى الإطار المضمّن iframe عبر مربعات حوار المشاركة الأصلية للجهاز the device's native share dialogs.</p>
<h4>الكود :</h4>
<div class="sourcecode">
<pre><span>code <br></span><code>
<h1>إطار iframe لعرض الفيديو</h1>
<iframe
width="560"
height="315"
src="https://www.youtube.com/embed/I0_951_MPE0"
allow="accelerometer autoplay clipboard-write encrypted-media gyroscope web-share"
>
</iframe>
</code></pre>
</div>
<h4>معاينة :</h4>
<div class="preview" role="presentation">
<h1>
إطار iframe لعرض الفيديو
</h1>
<iframe width="560" height="315"
src="https://www.youtube.com/embed/I0_951_MPE0"
allow="accelerometer autoplay clipboard-write encrypted-media gyroscope web-share"
>
</iframe>
</div>
<br>
<h3>الخطوة السادسة :</h3>
<p>السمة التالية التي ستضيفها هي <code class="br">referrerpolicy</code>. وهي القاعدة <strong>rule</strong> التي تحدد مقدار التفاصيل التي تشاركها عند اتصال صفحتك بصفحة أخرى.</p>
<p>أضف سمة <code class="br">referrerpolicy</code> واضبطها على <code class="br">strict-origin-when-cross-origin</code>. تُشارك هذه السمة العنوان الكامل <em>full address</em> على نفس الموقع، واسم الموقع فقط على المواقع الأخرى، ولا شيء على المواقع غير الآمنة <em>insecure sites</em>.</p>
<h4>الكود :</h4>
<div class="sourcecode">
<pre><span>code <br></span><code>
<h1>إطار iframe لعرض الفيديو</h1>
<iframe
width="560"
height="315"
src="https://www.youtube.com/embed/I0_951_MPE0"
allow="accelerometer autoplay clipboard-write encrypted-media gyroscope web-share"
referrerpolicy="strict-origin-when-cross-origin"
>
</iframe>
</code></pre>
</div>
<h4>معاينة :</h4>
<div class="preview" role="presentation">
<h1>
إطار iframe لعرض الفيديو
</h1>
<iframe width="560" height="315"
src="https://www.youtube.com/embed/I0_951_MPE0"
allow="accelerometer autoplay clipboard-write encrypted-media gyroscope web-share"
referrerpolicy="strict-origin-when-cross-origin"
>
</iframe>
</div>
<br>
<h3>الخطوة الأخيرة :</h3>
<p>أخيرًا وليس آخرًا، السمة التي ستضيفها هي <code class="br">allowfullscreen</code>. وكما يوحي اسمها، فهي تسمح بمشاهدة الفيديو في وضع ملء الشاشة <em>full screen mode</em>.</p>
<h4>الكود :</h4>
<div class="sourcecode">
<pre><span>code <br></span><code>
<h1>إطار iframe لعرض الفيديو</h1>
<iframe
width="560"
height="315"
src="https://www.youtube.com/embed/I0_951_MPE0"
allow="accelerometer autoplay clipboard-write encrypted-media gyroscope web-share"
referrerpolicy="strict-origin-when-cross-origin"
allowfullscreen
>
</iframe>
</code></pre>
</div>
<h4>معاينة :</h4>
<div class="preview" role="presentation">
<h1>
إطار iframe لعرض الفيديو
</h1>
<iframe width="560" height="315"
src="https://www.youtube.com/embed/I0_951_MPE0"
allow="accelerometer autoplay clipboard-write encrypted-media gyroscope web-share"
referrerpolicy="strict-origin-when-cross-origin"
allowfullscreen
>
</iframe>
</div>
<h5>وبهذا انتهت الورشة!</h5>
</section>
</div>
<!-- Pages -->
<div class="page-nav">
<a class="prev" href="./basic15.html">→ السابق</a>
<a class="next" href="./basic17.html">التالي ←</a>
</div>
</main>
</body>
</html>