
/**
 * Snippet 121: iAsk Hero Video VideoObject Schema (JSON-LD)
 * Emits schema.org VideoObject + ImageObject markup on home and contact pages
 * so Google can index the hero video in Google Video search and rich results.
 */

add_action('wp_head', function() {
    if (!is_page([24, 661])) return;

    $base = 'https://iaskacademy.com/wp-content/uploads/2026/04';
    $is_home = is_page(24);

    $name = $is_home
        ? 'فيديو ترحيبي - أكاديمية آيسك للتعليم عن بعد | طلاب جامعيون عرب'
        : 'تواصل معنا - أكاديمية آيسك | طالبة جامعية محجبة تقرأ في الحرم الجامعي';

    $description = $is_home
        ? 'فيديو ترحيبي لأكاديمية آيسك يظهر طالبة جامعية محجبة تبتسم وتقرأ كتاباً في حديقة الحرم الجامعي - منصة تعليمية عربية للتعليم عن بعد والشهادات الأكاديمية المعتمدة دولياً'
        : 'صفحة التواصل مع أكاديمية آيسك للتعليم عن بعد - فيديو لطالبة جامعية محجبة تقرأ في حديقة الجامعة، يعكس قيمنا في التعليم الأكاديمي والثقة بالنفس';

    $thumbnail = $base . '/iask-academy-saudi-students-poster.jpg';
    $contentUrl = $base . '/iask-academy-saudi-students-hero.mp4';
    $upload_date = '2026-04-22T00:00:00+03:00';

    $schema = [
        '@context'     => 'https://schema.org',
        '@type'        => 'VideoObject',
        'name'         => $name,
        'description'  => $description,
        'thumbnailUrl' => [$thumbnail],
        'contentUrl'   => $contentUrl,
        'uploadDate'   => $upload_date,
        'duration'     => 'PT8S',
        'width'        => 1280,
        'height'       => 720,
        'inLanguage'   => 'ar',
        'isFamilyFriendly' => true,
        'publisher' => [
            '@type' => 'EducationalOrganization',
            'name'  => 'iAsk Academy - أكاديمية آيسك للتعليم عن بعد',
            'url'   => 'https://iaskacademy.com',
            'logo'  => [
                '@type' => 'ImageObject',
                'url'   => 'https://iaskacademy.com/wp-content/uploads/2025/12/iask-logo.png',
            ],
        ],
        'thumbnail' => [
            '@type'  => 'ImageObject',
            'url'    => $thumbnail,
            'width'  => 1920,
            'height' => 1080,
            'caption'=> 'طالبة جامعية محجبة تبتسم وتقرأ كتاباً في حديقة الحرم الجامعي - أكاديمية آيسك',
        ],
        'potentialAction' => [
            '@type'  => 'WatchAction',
            'target' => $contentUrl,
        ],
    ];

    echo "\n<!-- iAsk VideoObject Schema -->\n";
    echo '<script type="application/ld+json">' . wp_json_encode($schema, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT) . '</script>' . "\n";
}, 50);

// Add proper preload hint for poster image (LCP optimization)
add_action('wp_head', function() {
    if (!is_page([24, 661])) return;
    echo '<link rel="preload" as="image" href="https://iaskacademy.com/wp-content/uploads/2026/04/iask-academy-saudi-students-poster.jpg" fetchpriority="high">' . "\n";
}, 1);

// Add image alt text for poster when used as <img> elsewhere
add_filter('wp_get_attachment_image_attributes', function($attr, $attachment) {
    if (isset($attachment->ID) && in_array($attachment->ID, [7837, 7838, 7839])) {
        $attr['alt'] = 'طالبة جامعية محجبة سعودية تبتسم وتقرأ كتاباً في حديقة الحرم الجامعي - أكاديمية آيسك للتعليم عن بعد';
        $attr['loading'] = 'eager';
        $attr['fetchpriority'] = 'high';
    }
    return $attr;
}, 10, 2);<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="//iaskacademy.com/main-sitemap.xsl"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
	<sitemap>
		<loc>https://iaskacademy.com/post-sitemap.xml</loc>
		<lastmod>2026-04-13T14:44:12+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://iaskacademy.com/page-sitemap.xml</loc>
		<lastmod>2026-04-21T23:38:08+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://iaskacademy.com/links-sitemap.xml</loc>
		<lastmod>2026-03-24T07:25:52+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://iaskacademy.com/edu-sitemap.xml</loc>
		<lastmod>2026-04-21T22:34:02+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://iaskacademy.com/product-sitemap.xml</loc>
		<lastmod>2026-03-23T11:27:20+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://iaskacademy.com/courses-sitemap.xml</loc>
		<lastmod>2026-03-23T11:27:20+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://iaskacademy.com/lesson-sitemap1.xml</loc>
		<lastmod>2026-03-24T07:29:56+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://iaskacademy.com/lesson-sitemap2.xml</loc>
		<lastmod>2026-03-05T14:08:34+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://iaskacademy.com/lesson-sitemap3.xml</loc>
		<lastmod>2026-03-05T14:08:34+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://iaskacademy.com/tutor_quiz-sitemap.xml</loc>
		<lastmod>2026-03-05T14:08:34+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://iaskacademy.com/tutor_assignments-sitemap.xml</loc>
		<lastmod>2026-03-05T14:08:34+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://iaskacademy.com/category-sitemap.xml</loc>
		<lastmod>2026-04-13T14:44:12+00:00</lastmod>
	</sitemap>
</sitemapindex>
<!-- XML Sitemap generated by Rank Math SEO Plugin (c) Rank Math - rankmath.com -->