Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Hộp thoại Truyền sẽ xuất hiện mỗi khi bạn nhấn vào nút Truyền. Hộp thoại Truyền cho phép người dùng kết nối, điều khiển và ngắt kết nối với Trình thu web.
Nếu đang phát triển một phương thức triển khai tuỳ chỉnh hoặc xây dựng một ứng dụng cho iOS hoặc Chrome, bạn phải triển khai hộp thoại này một cách nhất quán để người dùng nhận ra và tin tưởng rằng hộp thoại này hoạt động nhất quán trên các thiết bị, ứng dụng và nền tảng. Hãy tham khảo Ứng dụng tham khảo để biết ví dụ.
Bắt buộc (hành vi mặc định của
Android MediaRouter): A Khi ứng dụng gửi không được kết nối với trình nhận Cast, thao tác nhấn vào nút Cast (Truyền) sẽ hiển thị hộp thoại Cast (Truyền) B Tiêu đề hộp thoại Cast (Truyền), "Cast to" (Truyền đến) sẽ xuất hiện C Hộp thoại Cast (Truyền) sẽ hiển thị danh sách các Trình nhận web hiện có D Mỗi trình nhận hiện đang truyền sẽ hiển thị "Casting app name" (Đang truyền tên ứng dụng)
Lưu ý các trường hợp có nhiều người dùng:
Khi một người dùng khác kết nối với một thiết bị nhận đang truyền từ cùng một ứng dụng và tài khoản, ứng dụng gửi sẽ cung cấp các chế độ điều khiển cho nội dung truyền.
Khi một người dùng khác kết nối với một thiết bị nhận đang truyền từ một ứng dụng không truyền, ứng dụng gửi trước đó sẽ ngắt kết nối và ứng dụng gửi mới sẽ kết nối.
Đối với iOS, khi truyền lần đầu tiên, người dùng phải đồng ý cho phép truy cập vào mạng cục bộ (LNA) cho các thiết bị Cast. Màn hình thông tin xen kẽ sẽ hiển thị cho người dùng, giải thích lý do cần có quyền này, theo sau là hộp thoại quyền LNA tiêu chuẩn của Apple.
Sau lần truyền đầu tiên, nếu không tìm thấy thiết bị nào khi nhấn vào nút Truyền trong khi người dùng đang dùng Wi-Fi, thì màn hình trợ giúp sẽ xuất hiện để giải thích lý do có thể không dùng được Trình thu web (ví dụ: quyền truy cập mạng cục bộ bị tắt hoặc có sự cố với mạng Wi-Fi).
Bắt buộc:
A Truyền lần đầu: Sau khi nhấn vào nút Truyền lần đầu,
một quảng cáo xen kẽ phải xuất hiện để giải thích cho người dùng lý do họ nên cho phép
ứng dụng truy cập vào các thiết bị mạng cục bộ. Quảng cáo xen kẽ phải bao gồm thông tin về lý do cần có quyền truy cập mạng cục bộ để tăng khả năng người dùng chấp nhận quyền truy cập cục bộ.
B Không có Receiver: Khi nhấn vào nút Truyền,
màn hình trợ giúp sẽ hiển thị giải thích lý do có thể khiến người dùng
không thể khám phá Web Receiver, cùng với các đường liên kết đến phần Cài đặt để khắc phục vấn đề về quyền LNA.
Truyền lần đầu (iOS)
Lần truyền đầu tiên: quyền truy cập mạng cục bộ và quyền hiển thị quảng cáo xen kẽ
Bắt buộc A Khi ứng dụng gửi được kết nối với Trình nhận trên web,
thao tác nhấn vào nút Truyền sẽ hiển thị hộp thoại Truyền
B Tiêu đề hộp thoại Truyền "Tên-trình-nhận" sẽ xuất hiện
C Hộp thoại Truyền sẽ hiển thị một nút để dừng truyền
với nhãn nút "DỪNG TRUYỀN" (để biết thêm thông tin về cách ngắt kết nối, hãy xem phần
Trình gửi dừng truyền)
Bắt buộc A Tiêu đề hộp thoại Truyền "Receiver-Name" (Tên thiết bị nhận) xuất hiện
B Thiết bị nhận hoặc nội dung đang truyền sẽ xuất hiện bên dưới
tiêu đề
C Hộp thoại Truyền hiển thị nút "STOP CASTING" (DỪNG TRUYỀN) để dừng
truyền (để biết thêm thông tin, hãy xem phần
Trình gửi dừng truyền)
Phương pháp hay nhất
Để mang lại trải nghiệm tốt nhất cho người dùng, hãy cung cấp các chế độ điều khiển ổn định ngoài các chế độ điều khiển trong hộp thoại Truyền.
Android
Hộp thoại truyền, trong khi truyền
Thiết bị nhận phát nội dung
iOS
Hộp thoại truyền, trong khi truyền
Thiết bị nhận phát nội dung
Chrome
Hộp thoại truyền, trong khi truyền
Thiết bị nhận phát nội dung
Hình ảnh được sử dụng trong hướng dẫn thiết kế này
là của Quỹ Blender, được chia sẻ theo bản quyền hoặc giấy phép Creative Commons.
Elephant's Dream: (c) bản quyền 2006, Blender Foundation / Netherlands Media Art Institute /
www.elephantsdream.org
Sintel: (c) bản quyền của Blender Foundation | www.sintel.org
Tears of Steel: (CC) Blender Foundation | mango.blender.org
Big Buck Bunny: (c) bản quyền 2008, Blender Foundation / www.bigbuckbunny.org
[null,null,["Cập nhật lần gần đây nhất: 2025-08-31 UTC."],[[["\u003cp\u003eThe Cast dialog enables users to connect to, manage, and disconnect from Web Receivers and should be implemented consistently across platforms.\u003c/p\u003e\n"],["\u003cp\u003eOn iOS, users must grant local network access permission for initial casting and may encounter a help screen if no devices are found.\u003c/p\u003e\n"],["\u003cp\u003eWhen connected, the Cast dialog displays the receiver name and a "STOP CASTING" button, offering controls for the casting session.\u003c/p\u003e\n"],["\u003cp\u003eFor optimal user experience, it's recommended to include persistent controls alongside those within the Cast dialog, enhancing user interaction.\u003c/p\u003e\n"],["\u003cp\u003eAndroid apps can leverage the MediaRouter component for built-in Cast dialog UX, simplifying implementation.\u003c/p\u003e\n"]]],[],null,["# Cast Dialog\n\nThe Cast dialog is shown whenever the Cast button is pressed. The Cast dialog lets users\nconnect, control, and disconnect from Web Receivers.\n| **Note:** For Android apps, use the `MediaRouter` component from the MediaRouter Support Library to implement the Cast dialog. It has all of the UX requirements built right in.\n| **Note:** For iOS senders, a special Local Network Access interstitial dialog must be displayed the first time a user attempts to cast.\n\nIf you're developing a custom implementation or building an app for iOS or Chrome, you must\nimplement this dialog in a consistent way, so that users recognize and trust it to function\nconsistently across devices, apps and platforms. Refer to the\n[Reference apps](/cast/docs/sample_apps#reference_apps) for examples.\n\n### [Cast dialog, not connected (receivers available)](#sender-cast-menu-available)\n\n\n**Required** (default behavior of [Android MediaRouter](https://developer.android.com/reference/androidx/mediarouter/media/MediaRouter)):\n\n\nA When the sender app is not connected to a Cast receiver,\ntapping the Cast button shows the Cast dialog\n\n\nB The Cast dialog title, \"Cast to\" appears\n\n\nC The Cast dialog shows a list of available Web Receivers\n\n\nD Each receiver currently casting should display, \"Casting\n*app name*\"\n\n**Note the multi-user scenarios:**\n\n- When another user connects to a receiver currently casting from the same app and account, the sender app provides the controls for the cast content.\n- When another user connects to a receiver currently casting from an app that is not casting, the previous sender app disconnects and the new sender app connects.\n\n### Android\n\nCast dialog, not connected \nCast home screen \n\n### iOS\n\nCast dialog, not connected \nCast home screen \n\n### Chrome\n\nCast dialog, not connected \nCast home screen \n\n### [Cast dialog, not connected (iOS only)](#sender-cast-menu-available)\n\n\nFor iOS, when casting for the first time, users must consent to allow local network access (LNA) to\nCast devices. An interstitial information screen is presented\nto users explaining why this permission is needed, followed by the standard Apple LNA\npermissions dialog.\n\n\nAfter casting for the first time, if no devices are found when the Cast button is tapped while the\nuser is on Wi-Fi, a help screen is presented\nexplaining why Web Receivers might not be available (for example,\nlocal network access is disabled, or there is a problem with the Wi-Fi network).\n\n\n**Required** :\n\n\nA First-time casting: After tapping on the Cast button\nfor the first time,\nan Interstitial must be shown to explain to the user why they should allow\nthe app to access local network devices. The interstitial should include information on\nwhy local network access is needed, to increase the likelihood of the user accepting\nlocal permission access.\n\n\nB Receivers unavailable: Tapping the Cast button\ndisplays a help screen explaining possible reasons the user\nis unable to discover Web Receivers, along with links to Settings to fix LNA permissions issues. \n\n### First-time casting (iOS)\n\nFirst-time casting: interstitial and local network access permissions \n\n### Receivers unavailable\n\nReceivers unavailable \n\n### [Cast dialog, connected but not casting](#sender-cast-menu-connected)\n\n\n**Required**\n\n\nA When the sender app is connected to a Web Receiver,\ntapping the Cast button shows the Cast dialog\n\n\nB The Cast dialog title \"Receiver-Name\" appears\n\n\nC The Cast dialog shows a button to stop casting\nwith button label \"STOP CASTING\" (for more information about disconnecting, see\n[Sender stops cast](/cast/docs/design_checklist/sender#sender-control-end)) \n\n### Android\n\nCast dialog, connected but not casting \nReceiver app loaded / idle \n\n### iOS\n\nCast dialog, connected but not casting \nReceiver app loaded / idle \n\n### [Cast dialog, while casting](#sender-cast-menu-casting)\n\n\n**Required**\n\n\nA The Cast dialog title \"Receiver-Name\" appears\n\n\nB The receiver or content currently casting is shown below\nthe title\n\n\nC The Cast dialog shows a \"STOP CASTING\" button that stops\ncasting (for more information see\n[Sender stops cast](/cast/docs/design_checklist/sender#sender-control-end))\n\n**Best practice**\n\n- For the best user experience, provide [persistent controls](/cast/docs/design_checklist/sender#sender-mini-controller) in addition to the controls in the Cast dialog.\n\n### Android\n\nCast dialog, while casting \nReceiver playing content \n\n### iOS\n\nCast dialog, while casting \nReceiver playing content \n\n### Chrome\n\nCast dialog, while casting \nReceiver playing content \n\n**Images used in this design guide**\nare courtesy of the Blender Foundation, shared under copyright or Creative Commons license.\n\n- Elephant's Dream: (c) copyright 2006, Blender Foundation / Netherlands Media Art Institute / www.elephantsdream.org\n- Sintel: (c) copyright Blender Foundation \\| www.sintel.org\n- Tears of Steel: (CC) Blender Foundation \\| mango.blender.org\n- Big Buck Bunny: (c) copyright 2008, Blender Foundation / www.bigbuckbunny.org"]]