From 6e354c9e7e44d891b9447b131d373d2c7cc031ab Mon Sep 17 00:00:00 2001 From: Bhakti Shukla Date: Tue, 21 Oct 2025 14:58:18 -0700 Subject: [PATCH 1/2] feat: PE-1075: Update the dev-cookbook send message example to be @brightsign/messageport --- examples/README.md | 4 +++ .../plugin-message-transfer.bpfx | 32 +++++++++++-------- .../send-plugin-message/pluginMessageApp.html | 11 ++++--- 3 files changed, 28 insertions(+), 19 deletions(-) diff --git a/examples/README.md b/examples/README.md index 5666a63..87f40fc 100644 --- a/examples/README.md +++ b/examples/README.md @@ -44,6 +44,10 @@ Note that some starter examples include the creation of a `brightsign-dumps` fol - **Location**: `examples/bs-sqlite-db-example` - **Features**: Demonstrates SQLite database usage on BrightSign, including table creation, data insertion, querying, and cleanup via BrightScript and JavaScript communication. +#### MessagePort Example +- **Location**: `examples/messageport-example` +- **Features**: Shows how to use the BrightSign MessagePort API for bi-directional communication between BrightScript and JavaScript applications running on a BrightSign player. + #### Send Plugin Message Example - **Location**: `examples/send-plugin-message` - **Features**: Shows how to send plugin messages between BrightScript and HTML/JavaScript apps, useful for integrating BrightAuthor:connected presentations with custom logic. diff --git a/examples/send-plugin-message/plugin-message-transfer.bpfx b/examples/send-plugin-message/plugin-message-transfer.bpfx index f54ca0b..ec58c95 100644 --- a/examples/send-plugin-message/plugin-message-transfer.bpfx +++ b/examples/send-plugin-message/plugin-message-transfer.bpfx @@ -1,6 +1,6 @@ { "meta": { - "brightAuthorVersion": "1.32.0", + "brightAuthorVersion": "1.67.3", "buildType": "Standard" }, "bsdm": { @@ -493,7 +493,7 @@ } }, "wssDeviceSpec": {}, - "lastModifiedTime": "2024-12-04T19:08:01.246Z" + "lastModifiedTime": "2025-10-21T21:52:11.403Z" }, "zones": { "zonesById": { @@ -874,6 +874,10 @@ } } }, + "userDefinedEvents": { + "userDefinedEventsById": {}, + "sequence": [] + }, "htmlSites": { "dbb6ec59-cea2-4ecf-8f73-be3ddc806ceb": { "id": "dbb6ec59-cea2-4ecf-8f73-be3ddc806ceb", @@ -935,38 +939,38 @@ "a7408334-3742-4000-aa8b-06a472ee2000": { "id": "a7408334-3742-4000-aa8b-06a472ee2000", "name": "pluginMessageTransfer.brs", - "path": "/Users/jmedlin/Documents/dev-cookbook/examples/send-plugin-message/", + "path": "C:\\Users\\bshukla\\Projects\\dev-cookbook\\examples\\send-plugin-message\\", "networkId": 0, "location": "Local", "assetType": "BrightScript", - "scope": "ee6c9bdaa6478312", - "locator": "file:///Users/jmedlin/Documents/dev-cookbook/examples/send-plugin-message/pluginMessageTransfer.brs", - "fileSize": 2730, - "lastModifiedDate": "2024-10-11T20:42:56.163Z", + "scope": "605ba72e83c154f7", + "locator": "file://\\C:\\Users\\bshukla\\Projects\\dev-cookbook\\examples\\send-plugin-message\\pluginMessageTransfer.brs", + "fileSize": 4408, + "lastModifiedDate": "2025-03-11T18:08:39.778Z", "refCount": 1 }, "266a1712-2166-4000-a4ee-af7731079000": { "id": "266a1712-2166-4000-a4ee-af7731079000", "name": "pluginMessageApp.html", - "path": "/Users/jmedlin/Documents/dev-cookbook/examples/send-plugin-message/", + "path": "C:\\Users\\bshukla\\Projects\\dev-cookbook\\examples\\send-plugin-message\\", "networkId": 0, "location": "Local", "assetType": "HtmlSite", - "scope": "ee6c9bdaa6478312", - "locator": "file:///Users/jmedlin/Documents/dev-cookbook/examples/send-plugin-message/pluginMessageApp.html", - "fileSize": 1168, - "lastModifiedDate": "2024-12-04T02:23:29.903Z", + "scope": "605ba72e83c154f7", + "locator": "file://\\C:\\Users\\bshukla\\Projects\\dev-cookbook\\examples\\send-plugin-message\\pluginMessageApp.html", + "fileSize": 1359, + "lastModifiedDate": "2025-10-21T21:36:41.347Z", "refCount": 1 } }, "thumbnail": { "type": "image/jpeg", - "data": "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAMCAgICAgMCAgIDAwMDBAYEBAQEBAgGBgUGCQgKCgkICQkKDA8MCgsOCwkJDRENDg8QEBEQCgwSExIQEw8QEBD/2wBDA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aw54aM0ImpVXY5zXrD7Q6ppyxgRzBol6hBol6iFXuRMGY+UFo2NE71AXjbxtzTzNLQ3fbvtsvhOqKo6urX5qpa1/t2tV96n69P6I9yAd3stHaMRzmq3Seq60mWZZjQh//9k=", "size": { "width": 200, "height": 112 }, - "hash": "1036468d55269b122e620154e5104455aeb5372d" + "hash": "c726c6a6b3f8ba7a56d5e56333317d88d9d31357" } }, "selection": { diff --git a/examples/send-plugin-message/pluginMessageApp.html b/examples/send-plugin-message/pluginMessageApp.html index fcc1e96..2c3e630 100644 --- a/examples/send-plugin-message/pluginMessageApp.html +++ b/examples/send-plugin-message/pluginMessageApp.html @@ -11,18 +11,19 @@