calzoneman / sync

Node.JS Server and JavaScript/HTML Client for synchronizing online media
Other
1.47k stars 232 forks source link

[Feature Request] Add https://embed.nicovideo.jp/ to the list of sites that can be embedded. #735

Closed IamTenko closed 6 years ago

IamTenko commented 6 years ago

Recently nicovideo has finally made his videos embeddable and visible even if you are not logged into the site. You can do so by changing the domain of the site into embed.nicovideo.jp. Example: https://embed.nicovideo.jp/watch/sm29744946

I wanted to ask if it's possible to add it to the sites that can be embedded in cytube. I'd appreciate it a lot. Thanks in advance.

Xaekai commented 6 years ago

For this to be possible they must provide an API to allow sending commands for seeking and pausing the video to the iframe. Do you know if they added that too?

IamTenko commented 6 years ago

Well no I actually don't know. Is there a way to see it?

henke37 commented 6 years ago

Find a page like the one youtube offers that explains how to embed and control the player.

IamTenko commented 6 years ago

It's hard to do so because it's almost all in Japanese sadly. Any other way to find out? Like trying to see if it works, I don't know...

calzoneman commented 6 years ago

For CyTube to make use of a video provider, it needs 2 things:

  1. A metadata API used by the server to retrieve information about the video (title, duration, etc.)
  2. A player API used by the browser to control the video

For nicovideo, I can't find any official documentation about either of these. For (1), it looks like some people have uncovered the internal endpoints that expose metadata (example), but I was unable to find any resources, official or otherwise, about whether (2) is possible, even after poking around the player code itself.

Unfortunately, this means I'll have to close this issue as infeasible to implement. You can use the following embed code to dump the iframe in directly, but CyTube won't be able to synchronize it:

<!-- paste into the custom embed entry, the 4 squares icon next to the normal video add button -->
<iframe src="https://embed.nicovideo.jp/watch/sm29744946"></iframe>