Skip to content
This repository has been archived by the owner on Oct 16, 2023. It is now read-only.

[Casting] Cast from phone #38

Closed
botioni opened this issue Dec 20, 2017 · 35 comments
Closed

[Casting] Cast from phone #38

botioni opened this issue Dec 20, 2017 · 35 comments

Comments

@botioni
Copy link

botioni commented Dec 20, 2017

cast from phone not connecting

@yuliskov
Copy link
Owner

Casting depends solely on the firmware abilities. I can't see a way of fixing such behavior on unsupported devices.

Some source of thinking may be the next resources, but there are some drawbacks...
https://github.com/fraunhoferfokus/peer-dial
https://github.com/node-on-mobile/node-on-android

@javierpz
Copy link
Contributor

I am trying to cast from the YouTube app of my phone to a fire tv stick, latest model, and it doesn't work. The app shows the fire stick but it never finish the connection.

@yuliskov
Copy link
Owner

@javierpz Is casting problem observed on the 720 or 1080 versions?

@javierpz
Copy link
Contributor

Hello @yuliskov

First of all thank you for your work. I think it's awesome.

About the problem, it happens with the two modes. When I try to cast, your app launches YouTube on the fire stick but without login and without casting the video. And the phone says that it is connecting but it never connects. I can do any test you want. Thank you!!

@yuliskov
Copy link
Owner

Thanks for the your kind words.

So, at least, my app is able to lunch. It's not bad. Maybe there is something that I can do.

@yuliskov
Copy link
Owner

@javierpz Hi, friend. Check, the latest update.

@javierpz
Copy link
Contributor

@yuliskov Hi! The latest version is 6.12.20 published three days ago, which is the version I was trying. I smell a new version today haha

@yuliskov
Copy link
Owner

yuliskov commented Dec 26, 2017 via email

@javierpz
Copy link
Contributor

Hi! Still it doesn't work, same behavior. YouTube is launched on the fire TV stick and YouTube on the phone says "Connecting to..." until timeout error. It happens with three devices and with the official app works. Thank you.

@javierpz
Copy link
Contributor

The cast functionality of today release 6.12.24 is broken, after upgrade the phone doesn't list the device. Before the upgrade it didn't worked for me, but at least I was able to see the device. Thank you.

@yuliskov
Copy link
Owner

@javierpz thanks for the reply. I tried to do the same things as described in the amazon doc. Its pity that it didnt worked out.
https://developer.amazon.com/docs/fire-tv/dial-integration.html

@javierpz
Copy link
Contributor

Hi! I am trying to see what's wrong with that, and I think I have seen something. I think the latest release have a new mistake, you change on whisperplay.xml the dialid from "YouTube" to "SmartYouTubeTV". That's why the YouTube app doesn't recognize the casting service.

I have decompiled the official app from Amazon and I can see what it does. It's pretty similar to what you do, but they add the locale settings to params, e.g. "https://www.youtube.com/tv?hl=US_US&{{DIAL_PARAMS}}"

I will send to the link to the decompile code.

Thank you

@javierpz
Copy link
Contributor

goo.gl/4xjQFR

Inside you have the java files with the code.

I am also dev but I haven't installed the sdk and I have very little time to fix it by myself, but I can test and see what could happen.

Thank you

@yuliskov
Copy link
Owner

@javierpz first let me thank you for the your efforts. I've changed app name intentionally. It's is stated in Amazon's manual. OK. As there no changes then I'll revert old name and slightly change the url.

BTW: I've registered new name in the dial site (scroll down first table).
http://www.dial-multiscreen.org/dial-registry/namespace-database

@javierpz
Copy link
Contributor

I think the problem with the new dialid is that YouTube app on the phone is searching that dialid. Use your own dialid makes sense if you also have a client that use it, but that's not the case. I could be wrong, but that's what I have understood on docs. Thank you for your efforts and time!

@yuliskov
Copy link
Owner

@javierpz maybe you're right. I'll revert dialid to YouTube. Thanks.

@javierpz
Copy link
Contributor

Hi!

I installed the Sdk and debugged your app. I think I have found the problem. When the app launches, it start youtube without cast parameters, just youtube tv. Then if you cast from YouTube, the new URL with the token ID and the parameters sent from the phone are ignored because the app doesn't reload the web page, just open the page previously loaded, without parameters.

In intenthandler, on onNewIntent method the activity is always ACTION_MAIN, so the execution never does nothing in this method.

You can try it even without debug, just launch the app, open YouTube settings, or a video, or something and then push home button to exit to launcher. Then if you cast from your phone, the YouTube will open again but in the previously state, on the YouTube settings page or the selected page, ignoring the new URL generated with the parameters.

Also I have tried the URL generated directly in my pc browser and it works, so the problem is not the URL, the problem is it always ignore the new URL.

You should force to reload page with the new URL everytime it receives parameters by Dial.

Thank you!

@yuliskov
Copy link
Owner

@javierpz very interesting observations. I'll check them out!

@doktormerlin
Copy link

I can confirm that the Casting feature does not work from the YouTube App to Smart YouTube TV (stable)

Glad to hear that this is worked on. @yuliskov This is for both 720p and 1080p

@javierpz
Copy link
Contributor

Hello,

I have applied a fix to the code, so I hope it will work after the next release. But there are still one issue about cast from phone: when you cast the first video from the phone, it will not start until you push play button with the remote control of the device. Then you can play/stop and play other videos without problem with the phone. The problem is only the first time you cast a video.

I don't know where are the problem. Any idea?

Thank you!

@botioni
Copy link
Author

botioni commented Dec 29, 2017

The play isu is ther iven if you send a lonk from another app . it is noth releted to the cast roblem
Thanks for your work !!!

@yuliskov
Copy link
Owner

yuliskov commented Dec 29, 2017

Then you can play/stop and play other videos without problem with the phone. The problem is only the first time you cast a video.

@javierpz I have no clue. Seems that xwalk version (1080) doesn't have this problem.

@doktormerlin
Copy link

The cast feature is working now.

However there seems to be one minor bug with it.

First is language, my Fire TV is set to German. If you cast from your phone the language in the App is English (always from casting, not from starting through the App Drawer)

@EarlyMon
Copy link

53685ced - 720 launcher, Fire TV Stick

App appears to restart on cast from phone (youtube splash screen appears first, I don't remember if that's normal - I don't have a complaint about that part, just sharing what I see) - TV pops up a toast message correctly identifying my phone as the casting source - TV then displays the correct YouTube title and a time line going from 0:00 to 0:00

Tapping the play icon on the phone does nothing, phone says still connecting

Please let me know if I can provide other information and MANY THANKS for the nice work on this app and your attention to detail!

@yuliskov
Copy link
Owner

@doktormerlin could you post a screens with english ui?
@EarlyMon some screens also would be good.

@javierpz
Copy link
Contributor

@doktormerlin I think that issue is because we add the parameter hl=Us-us. We should remove it and then it will work.

@EarlyMon this issue seems to be the same as I described before. If you press the play button directly on your device with a remote controller or something, it will start playing and after that, it will work with your phone. It seems that with 1080p mode doesn't happens.

@yuliskov
Copy link
Owner

@javierpz seems that you're right! Thanks again.

@doktormerlin
Copy link

With the newest update the language works fine and also the splash screen reappearing seems fixed - great work!

@javierpz
Copy link
Contributor

I have added a fix that will prevent the reload of the entire site when another device connects to cast. With this fix, it's possible to connect more than one device without rebooting every time a device tries to connect.

Please @yuliskov check if you see it right. All parameters will be addead after the hash, so it will never reload the entire page, it will just process the parameters after the hash.

Thank you!

@yuliskov yuliskov added the bug label Dec 30, 2017
@EarlyMon
Copy link

The latest update fixed the reloading so I don't think that screens from me are still required, please correct me if I am wrong.

@javierpz - I misunderstood your first description but of course you are correct, tapping the remote play button on 720p starts the player.

If that can't be corrected, maybe some notes about it on the smartyoutubetv.github.io page would be beneficial and prevent reports about it.

@yuliskov
Copy link
Owner

@EarlyMon agree with you. I think its time to add 'Known bugs' section to the site.

@Drakemaster
Copy link

Since the last update most things work on FireTV. If the app is active and if the app is not opened, I can cast videos but if you put the running app in background, it's not working. I am able to cast, the app is opening but the video won't be casted.

@doktormerlin
Copy link

Some bugs that happen with Cast from phone right now:

  1. When the Fire TV is in Screensaver mode, the video starts without disrupting the screensaver (you need to press a button on the remote to see the video again)
  2. Sometimes when opening the app, it starts the last video you casted (even after the Fire TV was shut down)
  3. This is not a bug, but maybe it would be possible to not show the update dialogue when using cast from phone? It's a bit annoying to search for the remote to hide that menu or download the update. I don't want to completely disable update notifications though

@jmgraeffe
Copy link

jmgraeffe commented Nov 22, 2018

For me (Fire TV Stick, stable release), the cast from phone works but it does not sync the time and I can't pause/resume/volume-control from phone. I know it's probably a lot of work but it would be so cool to have it working again. Thanks for your awesome work!

The latest release on GitHub does work in terms of casting from phone, but there is no video output for me unfortunately. And tbh I am a little bit confused about your versioning. The stable version is newer than the last test release on GitHub?

@yuliskov yuliskov changed the title Cast from phone [Casting] Cast from phone Dec 21, 2018
@chudoga
Copy link

chudoga commented Mar 8, 2021

An error occurs when I cast the screen to Mi TV 4a
TV 6.17.730
phone 16.08.35
MiPlay
IMG_20210308_140229
Screenshot_2021-03-08-14-01-28-916_com google android youtube

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants