Cast - Intterupt with temp stream - Resume original - casting

I would like to be able to pause a currently playing steam ...
i.e. music or video ...
Then play a TextToSpeech stream ... then resume the original stream.
Should that be an easy use-case ?
(I already have the ability to pause and play the TextToSpeech stream using the default media player)
I capture the original App and Media object ... but can't seem to restart them.
I can launch the original app ... but I can seem to it to load the media.
The app I am interrupting for testing is "Tune In"

You only have control over your own app; you can pause the playback of video from a different app but you cannot "pause" an app, load your own app and then "resume" the other app when you're done with your own app. When you load your own app, you are terminating the other app and from that point on, there isn't much you can do to "resume" the other app to the state it was (=(unless you own the other app, too).

Related

How to broadcast audio *from* my website to clients

I want to have a button on a (private) webpage on my site that, when clicked, starts an audio stream from the computer of the user who pressed the button.
Then, I want that stream to be accessible on another webpage on my site.
I'm aware of YouTube, Periscope, Spreaker, and others, but it is my understanding that the broadcast, using these services, is initiated through their website or apps. I'm ok with the broadcaster having to download a plugin on-the-fly (that is, after he has pressed the button), but I want to avoid the broadcaster having to install software, or having to use an alternative website.
So, what I'm looking for is a service/API that somehow takes a live audio recording within a browser, and repackages that as a live feed, to be used in an (embedded) player, elsewhere.
I'm aware of software like Kurento, but I do not want to maintain the infrastructure myself. I just want the service/API to take care of that.
I'm also aware of join.me's API, but it's my understanding that the broadcaster still needs to install software to broadcast.
This service does not have to be free. And this service should (of course) not use Flash.
Does this exist?

How do i publish a persistent live card in the Glass GDK?

So I've got my live card working with the v12 GDK. It responds to a voice trigger and then sits there until the user stops it.
However, I can't determine how to create an always present live card which always remains on the left side of the timeline. Some apps already do this, the Settings app and Weather app, for instance. But I've been unable to make the same happen for my app; I can't find any hook on Glass start like the GlobalAlarmReceiver for normal Android apps.
Am I missing something?
To make a live card that will remain in the timeline even if the user reboots the device, you may want to try the techniques described here to register a broadcast receiver that detects when the system is booted and you can start your service from there.
Your users will still need to use a voice trigger to start it once after installing it, though (either that, or reboot their device, which is even less desirable). This is because on Android, the ACTION_PACKAGE_ADDED broadcast that gets sent when an application is installed doesn't get sent to the application that was just installed.

Playback not working in offline mode when trying to play offline playlist (libspotify 9.1.32 / armv7 build)

I have an issue with libspotify and playback of offline synchronized playlists. When there is no active internet connection, the login suceeds (and sp_session_connectionstate reports that user is logged-in offline); however playback does not work when trying to play back any track on an offline playlist. Playback does work if logging in with an active internet connection, and then switching the connection off (i.e., seems that it is necessary to be online initially for offline playback to work). Is this an issue with the library, and in such case, can a fix be expected?
I wouldnt count on a fix from Spotify. They barely listen to the people who use their API.

Attach a video stream onto an existing application

Is it possible to show a video that is playing onto an existing application?
Application A is running.
Get Video A and place it on top of Application A and then play it.
Thanks! Cheers!
If you mean to load a video and play it, you can use the DirectShow API, which will use the installed Windows codecs to attempt playback. You can also use ffmpeg for a selection of codecs that may not be installed on the computer.

Windows Service with GUI monitor?

I have a C++ Win32 application that was written as a Windows GUI project, and now I'm trying to figure out to make it into a Service / GUI hybrid. I understand that a Windows Service cannot / should not have a user interface. But allow me to explain what I have so far and what I'm shooting for.
WHAT I HAVE NOW is a windows application. When it is run it places an icon in the system tray that you can double-click on to open up the GUI. The purpose of this application is to process files located in a specified directory on a nightly schedule. The GUI consists of the following:
A button to start an unscheduled scan/process manually.
A button to open a dialog for modifying settings.
A List Box for displaying status messages sent from the processing thread.
A custom drawn window for displaying image data (the file processing includes the creation and saving of images).
A status bar - while a process is not running, it shows a countdown to the next scheduled scan. During a scan it also provides some status feedback, including a progress bar.
WHAT I'M SHOOTING FOR is a service that will run on boot-up and not require a user to login. This would consist of the scheduled file processing. However, when a user logs in I would still like the tray icon to be loaded and allow them to open up a GUI as I described above to monitor the current state of the service, change settings, start a scan manually, and monitor the progress of a scan.
I'm sure that I have seen applications like this - that function as a service even when I'm not logged in, but still give me a user interface to work with once I do log in.
I'm thinking that instead of having a single multi-threaded application that sends messages to the GUI thread from the processing thread, I need two applications - a Service to perform the processing and a GUI application to provide visual feedback from the Service and also send messages to the Service (for example, to start a scan manually). But I am new to Windows Services and have no idea how this is done.
It is also possible that I'm completely off base and a Service is not what I'm looking for at all.
Any help / ideas / suggestions would be greatly appreciated! Thank you.
You can't do this as a service.
You'll need to make your Windows Service as a normal service application. This will startup on system startup, and run the entire time the system is up.
You'd then make a completely separate GUI application, which "talks" to the service. This can be set to run when a user logs in, in the user's account.
In order to make them "talk" to each other, you'll need to use some form of IPC. Since these run on the same system (but in different accounts, typically), named pipes or sockets both work quite well.
There is a simple way of doing it.
You can’t have the service access any user’s session (session 1,2,3..) since services are isolated and can access session 0 only. This is a change from 2011.
You should write a win32 program to be launched by your service per each user who logs in using https://msdn.microsoft.com/en-us/library/windows/desktop/ms682429(v=vs.85).aspx
The service can continue performing any task that isn’t user specific.