راه اندازی برای توسعه با Cast Application Framework (CAF) برای وب
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
Web Sender SDK در مرورگرهای وب با پشتیبانی Cast در دستگاههای Mac، Windows، Linux، ChromeOS و Android پشتیبانی میشود. برای برنامههای Cast بومی تلفن همراه، برنامههای Android و iOS Apps را ببینید.
راه اندازی
کتابخانه Web Sender API را به پروژه خود اضافه کنید
برای استفاده از Web Sender API، اسکریپت زیر را در صفحه وب خود قرار دهید:
به غیر از ثبت برنامه و دستگاه Web Receiver خود، برای استفاده از Web Sender SDK، هیچ مرحله تنظیم خاصی لازم نیست.
برای ثبت برنامه و دستگاه گیرنده وب خود، مراحل ثبت نام را دنبال کنید. هنگامی که شناسه برنامه خود را دارید، آماده توسعه برنامه فرستنده وب خود هستید.
تست دکمههای Cast
در حالی که برنامه Web Sender شما باید دکمه Cast خود را داشته باشد، کاربر همچنین میتواند با انتخاب Cast از منوی کلیک راست، ویژگی Cast را فراخوانی کند، همانطور که در اینجا نشان داده شده است:
برنامه فرستنده وب شما باید هر دو مورد را مدیریت کند.
کانال بتا کروم
یک کانال بتا عمومی برای Chrome نیز در دسترس است. نسخههای جدید Chrome قبل از انتشار کامل به کانال بتا منتقل میشوند. کانال بتا نیز بیشتر از کانال پایدار به روز می شود. این به توسعه دهندگان (و پذیرندگان پرشور اولیه) دسترسی قبلی به ویژگی های جدید را می دهد و به شما امکان می دهد مطمئن شوید که سایت شما با نسخه های آینده Chrome کار می کند.
برای گزارش مشکلات، روی نماد نوار ابزار Cast کلیک راست کرده و "گزارش یک مشکل" را انتخاب کنید. ما نمی توانیم به صورت جداگانه به اکثر بازخوردها پاسخ دهیم، اما برای ورودی کانال بتا ارزش زیادی قائل هستیم.
قبل از اینکه بهروزرسانیها را به سایت زنده خود فشار دهید، مطمئن شوید که با نسخه پایدار فعلی Chrome آزمایش میکنید. اکثر بازدیدکنندگان سایت شما نسخه پایدار کروم را نصب میکنند و اگر به ویژگیهای فقط بتا وابسته باشید، کاربران دارای نسخه پایدار تحت تأثیر قرار خواهند گرفت.
تاریخ آخرین بهروزرسانی 2025-01-09 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-01-09 بهوقت ساعت هماهنگ جهانی."],[[["\u003cp\u003eThe Web Sender SDK enables web applications on various platforms, including Mac, Windows, Linux, ChromeOS, and Android, to cast content to Cast-supported devices, excluding iOS Chrome.\u003c/p\u003e\n"],["\u003cp\u003eTo integrate the Web Sender API, developers need to add a specific script to their web page and register their Web Receiver app and device, obtaining an application ID.\u003c/p\u003e\n"],["\u003cp\u003eWeb Sender apps should accommodate both user-initiated casting through a dedicated Cast button and the browser's right-click menu, ensuring compatibility and user experience.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can leverage the Chrome beta channel to access and test upcoming features and ensure compatibility, but should prioritize testing with the stable version for live site updates.\u003c/p\u003e\n"],["\u003cp\u003eWeb Sender apps must support HTTPS to ensure Cast functionality, as browsers are phasing out support for the Presentation API on insecure origins.\u003c/p\u003e\n"]]],[],null,["# Setup for Developing with the Cast Application Framework (CAF) for Web\n\nThe Web Sender SDK is supported on Cast-supported web browsers on Mac, Windows,\nLinux, ChromeOS, and Android devices. For native mobile Cast apps see\n[Android Apps](/cast/docs/android_sender_setup) and\n[iOS Apps](/cast/docs/ios_sender_setup).\n| **Note:** Casting is not supported on the iOS Chrome browser.\n| **Warning:** Web Sender apps need to support HTTPS to maintain Cast compatibility, as browsers have deprecated support for the `Presentation API` on insecure origins.\n\nSetup\n-----\n\n### Add Web Sender API library to your project\n\nTo use the Web Sender API, include the following script in your web page: \n\n \u003cscript src=\"//www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1\"\u003e\u003c/script\u003e\n\n| **Note:** Updates to the Web Sender SDK occur automatically for all users, and provide fixes, user-facing features, and SDK capabilities. Updates are backwards-compatible and should be transparent to your site.\n\n### Registration\n\nOther than registering your Web Receiver app and device, no special setup steps\nare required to use the Web Sender SDK.\n\nTo register your Web Receiver app and device follow the steps at\n[Registration](/cast/docs/registration). Once you have your **application ID**,\nyou're ready to develop your Web Sender app.\n\nTesting Cast buttons\n--------------------\n\nWhile your Web Sender app should have its own Cast button, a user can also\ninvoke the cast feature by choosing **Cast** from the right-click menu, as shown\nhere:\n\nYour Web Sender app should handle both cases.\n\nChrome beta channel\n-------------------\n\nA public beta channel for Chrome is also available. New versions of Chrome are\npushed to the beta channel prior to a full release; the beta channel is also\nupdated more often than the stable channel. This gives developers (and\npassionate early adopters) advance access to new features, and allows you to\nensure that your site works with upcoming versions of Chrome.\n\nTo use the public beta channel:\n\n- [Install the beta version of Chrome](https://www.google.com/chrome/browser/beta.html)\n- To report issues, right-click on the Cast toolbar icon and choose \"Report an issue\". We can't respond individually to most feedback, but we greatly value the input on the beta channel.\n- Before pushing updates to your live site, ensure that you test with the current stable version of Chrome. Most visitors to your site will have the stable version of Chrome installed, and if you depend on beta-only features, users with the stable version will be impacted."]]