Jump to content

Problem when using API to play live TV while at screensaver


BillOatman

Recommended Posts

BillOatman

My shield had been sitting idle long enough at the emby main page to go into its screensaver.

I ran my application that changes the media to play a livetv channel on the shield.  

I expected to see the shield wake up and display the live tv channel.

What happened instead was I could hear the live tv channels audio but the shield was still displaying the screen saver.

When I woke up the shield with the remote the audio was still playing.  Selecting a live tv channel played the video correctly, but both channels audio.

I went in and out of emby and could not get the original channels audio to turn off.  Even at the shield main menu, the audio was still playing.

The only way I found to get rid of that audio was to reboot the shield.

 

 

Link to comment
Share on other sites

BillOatman

Hi.  One that I am developing.

The logic is:

Standard API authentication and get sessionID of the client device (I can provide that code if desired)

 

           // Send info message to the user that the channel is changing
            MessageCommand mc = new MessageCommand();
            mc.TimeoutMs = 5000;
            mc.Header = "Channel Change Reminder for " + clientUserName;
            mc.Text = "Channel will change to " + newChannel + " within " + (mc.TimeoutMs/1000).ToString() + " seconds.";         

            await client.SendMessageCommandAsync(sessionID, mc);
            System.Threading.Thread.Sleep((int)mc.TimeoutMs);

            // Locate the channel
            LiveTvChannelQuery ltQuery = new LiveTvChannelQuery();
            QueryResult<ChannelInfoDto> cInfo = await client.GetLiveTvChannelsAsync(ltQuery);

            string[] playList = new string[1];            

            foreach (ChannelInfoDto ch in cInfo.Items)
            {
                if (ch.Name.ToLower() == newChannel.ToLower())
                {
                    playList[0] = ch.Id;
                    break;
                }
            }

            // Play the channel
            PlayRequest pr = new PlayRequest();
            pr.PlayCommand = PlayCommand.PlayNow;
            pr.ItemIds = playList;
            await client.SendPlayCommandAsync(sessionID, pr);
Link to comment
Share on other sites

BillOatman

I never use the web app.  But I think I should be able to try it without too much effort.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...