google-cast

Chromecast SDK (Android) - is there a way to check whether the media playing on the cast device has finished playing?

随声附和 提交于 2019-11-29 15:40:35
Is there an onFinished listener of some sort? Or do we have to compare the current stream position against the duration of the track? Silva2351 It's not pretty but you can make this call: if (mRemoteMediaPlayer.getMediaStatus().getPlayerState() == MediaStatus.PLAYER_STATE_IDLE && mRemoteMediaPlayer.getMediaStatus().getIdleReason() == MediaStatus.IDLE_REASON_FINISHED) { ... } Prem, There is currently no callback to register for such event. One alternative (and-not-so-pretty) approach is the following: on the receiver, listen for "ended" event of the media element and send an event back to the

Is avc1.66.31,mp4a.40.2 supported by the Chromecast device?

会有一股神秘感。 提交于 2019-11-29 12:52:49
I have an m3u8 file that looks like this: #EXTM3U #EXT-X-VERSION:3 #EXT-X-STREAM-INF:BANDWIDTH=2048805,CODECS="avc1.66.31,mp4a.40.2",RESOLUTION=1280x720 chunklist_w517510829.m3u8 And I get the following error when trying to play it: Uncaught NotSupportedError: Failed to execute 'addSourceBuffer' on 'MediaSource': The type provided ('video/mp2t; codecs="avc1.66.31,mp4a.40.2"') is unsupported. player.js:1682 Uncaught TypeError: undefined is not a function Strangely enough it plays fine on the Chromecast if I remove avc1.66.31,mp4a.40.2 . I am using this sample as a player https://github.com

Steps to programmatically cast from android to miracast receiver

巧了我就是萌 提交于 2019-11-29 06:56:24
I'm trying to write an app that will start casting the screen from an Android phone to a TV via miracast. I'm using an HDMI dongle since the TV in question doesn't natively support miracast. I have been trying the code here , but it needs an Application ID which I have got following these steps . My question is, the instructions seem to indicate that I need to register the miracast dongle so it will talk to an unpublished 'debug' app. However, only Google Cast devices are mentioned and that isn't the same protocol as miracast. Do I still need to register the dongle? Is there a simpler way of

How do I discover a Chromecast device using Android?

五迷三道 提交于 2019-11-29 06:34:20
问题 I'd like to discover a Chromecast device and adjust the volume. 回答1: Get a device Get your device whitelisted (you'll need the device serial #, and a URL for your HTML5 receiver) You'll be sent two APPID (development / production) In your development environment make sure to update to Android Support Library v18 You'll be using MediaRouter Initialize import com.google.cast.CastContext; Context applicationContext = …; CastContext castContext = new CastContext(applicationContext); You'll need a

Open Chromecast YouTube video from my Android app

爷,独闯天下 提交于 2019-11-28 19:54:40
I'm able to use my own whitelisted url for feeding my chromecast videos, but can I make it stream a YouTube video directly from my app? I assume all I would need is to launch the YouTube app remotely and feed it a video ID somehow, but I can't find out how to do that. Has anyone done this from an Android app? Thanks. Not sure if you are still looking for a solution for this. The way to do it is as follows: MimeData data = new MimeData("v=g1LsT1PVjUA", MimeData.TYPE_TEXT); mSession.startSession("YouTube", data); The above should create a YouTube session and play the video. I suspect Google

Chromecast SDK (Android) - is there a way to check whether the media playing on the cast device has finished playing?

♀尐吖头ヾ 提交于 2019-11-28 08:57:26
问题 Is there an onFinished listener of some sort? Or do we have to compare the current stream position against the duration of the track? 回答1: It's not pretty but you can make this call: if (mRemoteMediaPlayer.getMediaStatus().getPlayerState() == MediaStatus.PLAYER_STATE_IDLE && mRemoteMediaPlayer.getMediaStatus().getIdleReason() == MediaStatus.IDLE_REASON_FINISHED) { ... } 回答2: Prem, There is currently no callback to register for such event. One alternative (and-not-so-pretty) approach is the

Chromecast receiver, how to load media without explicit cast sender request?

元气小坏坏 提交于 2019-11-28 05:13:04
问题 Media exists on an external server that I would like to play on my cast receiver (a modified version of Google's CastReferencePlayer). The receiver is in constant communication with this server (via long-polling), and is instructed by the server when it needs to play a certain media file. The issue I'm having is that I need the receiver to be able to essentially "tell itself" to play this media. This breaks with the standard sender-receiver communication protocol, but is necessary for my

Display web sites and web apps with Chromecast

主宰稳场 提交于 2019-11-28 04:43:31
Can Chromecast be used to display a web site or web app? All the sample sender/receivers I've seen so far show how to play videos. The docs posted so far are minimal as best, just an API reference with little explanation what any of it does. I just want to send a URL of my choosing and have that page displayed on the TV. There's no user interaction required past that point. Assuming that's possible, does anyone have sample Chrome sender and receiver code for that? kbriggs I was able to modify the Github sample Project > googlecast/CastHelloText-chrome to show a web page. In the receiver.html

Steps to programmatically cast from android to miracast receiver

我们两清 提交于 2019-11-27 18:12:52
问题 I'm trying to write an app that will start casting the screen from an Android phone to a TV via miracast. I'm using an HDMI dongle since the TV in question doesn't natively support miracast. I have been trying the code here, but it needs an Application ID which I have got following these steps. My question is, the instructions seem to indicate that I need to register the miracast dongle so it will talk to an unpublished 'debug' app. However, only Google Cast devices are mentioned and that isn

Open Chromecast YouTube video from my Android app

☆樱花仙子☆ 提交于 2019-11-27 12:34:16
问题 I'm able to use my own whitelisted url for feeding my chromecast videos, but can I make it stream a YouTube video directly from my app? I assume all I would need is to launch the YouTube app remotely and feed it a video ID somehow, but I can't find out how to do that. Has anyone done this from an Android app? Thanks. 回答1: Not sure if you are still looking for a solution for this. The way to do it is as follows: MimeData data = new MimeData("v=g1LsT1PVjUA", MimeData.TYPE_TEXT); mSession