Skip to content

Commit 41cf036

Browse files
authored
[tizen_app_control] Add YouTube app launch to the example (#932)
1 parent c95a018 commit 41cf036

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

packages/tizen_app_control/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
* Update minimum Flutter and Dart version to 3.13 and 3.1.
44
* Update code format.
5+
* Add YouTube app launch to the example.
56

67
## 0.2.3
78

packages/tizen_app_control/example/lib/main.dart

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,19 @@ class _MyAppState extends State<MyApp> {
8989
_localPort?.unregister();
9090
}
9191

92+
Future<void> _launchYoutube() async {
93+
const String videoId = 'N7J4hdrvsZA';
94+
final AppControl request = AppControl(
95+
appId: 'com.samsung.tv.cobalt-yt',
96+
operation: 'http://tizen.org/appcontrol/operation/default',
97+
extraData: <String, dynamic>{
98+
'PAYLOAD': '#watch?v=$videoId&launch=launcher',
99+
},
100+
);
101+
102+
await request.sendLaunchRequest();
103+
}
104+
92105
Future<void> _sendSms() async {
93106
final AppControl request = AppControl(
94107
operation: 'http://tizen.org/appcontrol/operation/share_text',
@@ -183,6 +196,11 @@ class _MyAppState extends State<MyApp> {
183196
child: Column(
184197
mainAxisSize: MainAxisSize.min,
185198
children: <Widget>[
199+
ElevatedButton(
200+
onPressed: _launchYoutube,
201+
child: const Text('Launch Youtube App (Only TV)'),
202+
),
203+
const SizedBox(height: 10),
186204
ElevatedButton(
187205
onPressed: _sendSms,
188206
child: const Text('Send SMS (No TV)'),

0 commit comments

Comments
 (0)