Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Support to share videos / preview links #254

Closed
pwFoo opened this issue Jul 3, 2019 · 5 comments
Closed

[Feature Request] Support to share videos / preview links #254

pwFoo opened this issue Jul 3, 2019 · 5 comments

Comments

@pwFoo
Copy link

pwFoo commented Jul 3, 2019

Hi @or-else,

I know you're busy with other features / tasks. Just to have the ideas added here.

@tairov
Copy link

tairov commented Aug 9, 2019

Hi @pwFoo ! Could you please elaborate how this feature should look like, how it should work?

@or-else
Copy link
Contributor

or-else commented Aug 10, 2019

It's a client-side feature. It's very similar to the way image attachments work. Pick one of the platforms for a start: webapp, Android or iOS. See how image attachments work:

  1. Drafty component IM for serialization in the corresponding SDK. Here is the spec: https://github.com/tinode/chat/blob/master/docs/drafty.md#im-inline-image-or-attached-image-with-inline-preview and here are implementations https://github.com/tinode/tinode-js/blob/master/src/drafty.js or https://github.com/tinode/tindroid/blob/master/tinodesdk/src/main/java/co/tinode/tinodesdk/model/Drafty.java or https://github.com/tinode/ios/blob/master/TinodeSDK/model/Drafty.swift. You only need to look at the IM object.
  2. Client-side generation and presentation. Here is an Android example:
    images are attached:
    https://github.com/tinode/tindroid/blob/69016a945506ae42fdd9d0eeba9166224604c57b/app/src/main/java/co/tinode/tindroid/MessagesFragment.java#L832
    presented:
    https://github.com/tinode/tindroid/blob/master/app/src/main/java/co/tinode/tindroid/media/SpanFormatter.java#L97

What you would need to go is

  1. Come up with a JSON video object for Drafty, similar to IM, say VD or VI. I suppose VD should contain all the data that IM has plus some more, like video duration, presence of sound, static picture of the title screen.
  2. Patch Drafty with the VD implementation (this is very small).
  3. Implement creation of the VD object on a client. This is nearly identical to other attachments except you need to grab the additional data from the video mentioned above: duration, if video has sound, capture screenshot.
  4. Implement download and playback on the client. This is probably the most involved part. Particularly if you want to implement playback while the video is being downloaded.

Let me know if you want to do it and I'll help you with questions or code reviews.

@or-else
Copy link
Contributor

or-else commented Dec 15, 2022

Video sharing is available in https://github.com/tinode/webapp/tree/next. Please test.

@or-else
Copy link
Contributor

or-else commented Jan 17, 2023

Videos release in 0.21.0-rc1

@or-else
Copy link
Contributor

or-else commented Jan 17, 2023

Closing this issue. Link previews moved to #820.

@or-else or-else closed this as completed Jan 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants