ফ্রেম-টু-ফ্রেম মেসেজিং ব্যবহার করুন
সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন
আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
এই পৃষ্ঠাটি বর্ণনা করে কিভাবে ক্লায়েন্ট সাইডে বার্তা পাঠাতে হয় সাইড-প্যানেল আইফ্রেমে চলমান একটি অ্যাড-অন থেকে প্রধান পর্যায়ের আইফ্রেমে চলমান অ্যাড-অনে। ফ্রেম-টু-ফ্রেম মেসেজিং শুধুমাত্র ক্লায়েন্ট সাইডে ঘটে, তাই বার্তা ডেলিভারি তাত্ক্ষণিক কাছাকাছি।
একটি বার্তা পাঠাতে:
await sidePanelClient.notifyMainStage("YOUR_MESSAGE");
await mainStageClient.notifySidePanel("YOUR_MESSAGE");
payload
দৈর্ঘ্য অবশ্যই তার নির্দিষ্ট আকারের সীমার সাথে সঙ্গতিপূর্ণ হবে।
বার্তাটি পেতে, অ্যাড-অনকে অবশ্যই frameToFrameMessage
কলব্যাকের সদস্যতা নিতে হবে। নিম্নলিখিত কোড নমুনা দেখায় কিভাবে একটি frameToFrameMessage
কলব্যাকে সদস্যতা নিতে হয়:
sidePanelClient.on('frameToFrameMessage', (arg: FrameToFrameMessage) => {
// YOUR_CODE
});
GitHub-এ "অ্যানিমেশন" নমুনা অ্যাড-অনে ফ্রেম-টু-ফ্রেম মেসেজিংয়ের সম্পূর্ণ উদাহরণ রয়েছে। ক্রিয়াকলাপ শুরু হওয়ার পরে, ব্যবহারকারী যখনই একটি ইনপুট পরিবর্তন করেন তখন পার্শ্ব প্যানেলটি মূল পর্যায়কে অবহিত করে । মূল পর্যায়টি আপডেট হওয়া অবস্থা পেতে frameToFrameMessage
কলব্যাকের সদস্যতা নেয় ।
নোট
একটি প্রদত্ত অংশগ্রহণকারী দ্বারা প্রেরিত ফ্রেম-টু-ফ্রেম বার্তাগুলি শুধুমাত্র সেই একই অংশগ্রহণকারী দ্বারা দৃশ্যমান হয়৷ অন্যান্য অংশগ্রহণকারীদের বার্তা পাঠাতে বা রাজ্য পাঠাতে, কীভাবে অ্যাড-অন স্টেট শেয়ার করবেন তা শিখুন।
বার্তা বিতরণ শুধুমাত্র একবার চেষ্টা করা হয়. বার্তাগুলি গ্রহণ করতে, গ্রহণকারী প্যানেলটি অবশ্যই খোলা থাকতে হবে এবং বার্তা পাঠানোর আগে অ্যাপটিকে অবশ্যই কলব্যাকে সদস্যতা নিতে হবে৷
অন্য কিছু উল্লেখ না করা থাকলে, এই পৃষ্ঠার কন্টেন্ট Creative Commons Attribution 4.0 License-এর অধীনে এবং কোডের নমুনাগুলি Apache 2.0 License-এর অধীনে লাইসেন্স প্রাপ্ত। আরও জানতে, Google Developers সাইট নীতি দেখুন। Java হল Oracle এবং/অথবা তার অ্যাফিলিয়েট সংস্থার রেজিস্টার্ড ট্রেডমার্ক।
2025-08-29 UTC-তে শেষবার আপডেট করা হয়েছে।
[null,null,["2025-08-29 UTC-তে শেষবার আপডেট করা হয়েছে।"],[],[],null,["# Use frame-to-frame messaging\n\nThis page describes how to send messages on the client side from an\nadd-on running in the\n[side-panel](/workspace/meet/add-ons/guides/overview#side-panel) iframe to an\nadd-on running in the [main\nstage](/workspace/meet/add-ons/guides/overview#main-stage) iframe. Frame-to-frame\nmessaging only occurs on the client side, so message delivery is near\ninstantaneous.\n\nTo send a message:\n\n- From the side panel to the main stage, use the [`notifyMainStage()`](/workspace/meet/add-ons/reference/websdk/addon_sdk.meetsidepanelclient.notifymainstage) method.\n\n await sidePanelClient.notifyMainStage(\"\u003cvar translate=\"no\"\u003eYOUR_MESSAGE\u003c/var\u003e\");\n\n- From the main stage to the side panel, use the [`notifySidePanel()`](/workspace/meet/add-ons/reference/websdk/addon_sdk.meetmainstageclient.notifysidepanel) method.\n\n await mainStageClient.notifySidePanel(\"\u003cvar translate=\"no\"\u003eYOUR_MESSAGE\u003c/var\u003e\");\n\nThe [`payload`](/workspace/meet/add-ons/reference/websdk/addon_sdk.frametoframemessage.payload)\nlength must conform to its specified size limit.\n\nTo receive the message, the add-on must subscribe to\nthe\n[`frameToFrameMessage`](/workspace/meet/add-ons/reference/websdk/addon_sdk.addoncallbacks.frametoframemessage)\ncallback. The following code sample shows how to subscribe to a\n`frameToFrameMessage` callback: \n\n sidePanelClient.on('frameToFrameMessage', (arg: FrameToFrameMessage) =\u003e {\n // YOUR_CODE\n });\n\nThe [\"Animation\" sample add-on on GitHub](https://github.com/googleworkspace/meet/tree/3311b735550b8927c8b7ef2c6d06f768d9fe0476/addons-web-sdk/samples/animation-next-js)\nincludes a full example of frame-to-frame messaging. After the activity starts,\nthe side panel [notifies the main stage whenever the user changes an input](https://github.com/googleworkspace/meet/blob/3311b735550b8927c8b7ef2c6d06f768d9fe0476/addons-web-sdk/samples/animation-next-js/src/app/activitysidepanel/page.tsx#L27).\nThe main stage also [subscribes to the `frameToFrameMessage` callback](https://github.com/googleworkspace/meet/blob/3311b735550b8927c8b7ef2c6d06f768d9fe0476/addons-web-sdk/samples/animation-next-js/src/app/mainstage/page.tsx#L43)\nto receive updated state.\n\nNotes\n-----\n\n- Frame-to-frame messages sent by a given participant are *only* visible by\n that same participant. To send messages or state to other participants,\n learn how to [share add-on\n state](/workspace/meet/add-ons/guides/collaborate-in-the-add-on#collaboration).\n\n- Message delivery is only attempted once. To receive messages, the receiving\n panel must be open and the app must subscribe to the callback before the\n message is sent.\n\nRelated topics\n--------------\n\n- [Implement the Co-Doing API](/workspace/meet/add-ons/guides/use-CoDoingAPI)"]]