Is it able to get the player state with Samsung Smart TV SDK? - samsung-smart-tv

I have gone through the SEF plugin of the Samsung Smart TV API, and it seems there is no method like getState() or event like onstatechange...
Is there any method I can get the state of the player? Like 'Playing' or 'Pausing'?
or I can only self-defined a variable named state and change it time by time like the video example?
Any advice is pleased!

No. There is nothing like that. You must manage state by your own. You should change it while invoking Play or Stop and on events (like network error, etc...)

Related

Is there a way to know when nobody is broadcasting with Agora (Unity)

I'm trying to make a 'broadcast' video share in Unity, where only one person 'owns' the video, they have to press a button to 'be broadcaster' which shuts out all other users until the broadcaster stops or leaves.
What I need to know is, when the broadcaster stops or leaves, what's the best way to know that 'nobody is broadcasting'?
thanks for the question!
I'm fairly certain that the Agora SDK isn't able to explicitly tell how many users are in a channel. That functionality has to be handled inside a Unity script, instead of directly asking the Agora SDK.
I'd recommend using the OnUserOfflineHandler(), and checking to see if the 'special broadcasters' UID is equal to that of the user who just left, if so, fire some custom event you've created to alert interested subscribers.

Flutter persistent notification and service

I'm planning to develop simple audio player, but currently I'm stuck on notification support. I want notification that is persistent while audio is playing and I also need some controls (like play/pause, next/previous) and possibly fanart visible on notification. That's similar as most other player do (Aimp, Google Play Music etc).
I was looking forward for good example how to develop it using Dart/Flutter, well is that even possible without writing native code for each platform (Android/iOS)? Is there any plugin that supports that kind of notification on both platforms? Plus, of course, foreground service bound to it to don't kill audio playback when screen is off.
You might be interested in looking at package:audio_service which seems like it might handle the majority of the work for you, including the handling of background execution and notifications.
Also, for notifications I've had success with package:flutter_local_notifications but you shouldn't need this if you're going to use package:audio_service.

Apple watch event detection

Are anybody aware of any event api for the apple watch ? I'm looking for detecting events like on/off wrist events do determine if glances should be displayed or not.
There are not any events other than the simple ones declared in the various interface controls, like willActivate, didDeactivate, button taps, etc..
There are rumors that the next version of WatchKit this Fall will include more capabilities like being able to run some code on the watch itself, so maybe it'll be possible to have more event notifications once that comes out, but who knows.

iPhone headphone click detection

I've tried looking through the documentation, but I can't seem to find (or recognize) what I'm looking for.
The iPhone and iPod Touch have a momentary switch on the headphones, which I believe is called the "remote" (please correct me if I'm wrong). It is used to start/stop/forward/back for music or to pickup/end a phone call. I'd like to know when this switch is clicked in my native application.
In which framework and classes would I find this?
I don't believe this functionality is supported by any current framework.
If your application has iPod playback during execution you could register for MPMusicPlayerController notifications - Music Player Notifications
This will notify you of the playback state changes you mention above. However, it will not tell you whether the state was changed via the remote or the UI. But it's the only way that I know of to 'guess' if the remote button was clicked - I use this method in one of my own apps.

Is it possible to access data from the proximity-sensor of the iPhone surface?

When you hold the iPhone to your ear, it detects that there's something (proximity-sensor) and switches off the display.
is it possible to access this sensor in an iPhone app?
It is possible via undocumented System calls, this is how Google's voice search works on the iPhone to start listening when it is close to your ear (or so i'm told). The API isn't publicly exposed though so although google got the app on the store your app might be subject to more scrutiny.
Sorry I can't tell you exactly what the calls are.
I don't think so.
Rather, there aren't any published API's for it.
Google's voice search uses it, but that caused some fuss as they apparently used some unpublished functions.
http://www.iphonehacks.com/2008/11/iphone-app-news.html
EDIT:
To clarify, there are published API's allowing you to turn it on and off, but nothing that will allow you to detect when it has been triggered.
I was able to find this functionality in Apple's documentation here, however I haven't tried it yet.
The UIDevice instance also provides access to the proximity sensor state (described by the proximityState property). The proximity sensor detects whether the user is holding the device close to their face.