tinode / ios

Tinodios: Tinode Messaging Client for iOS
Apache License 2.0
243 stars 107 forks source link

Video messages. #189

Closed aforge closed 1 year ago

aforge commented 1 year ago

Should be generally working modulo minor glitches.

or-else commented 1 year ago

Landscape video is not displayed correctly:

Screenshot 2022-12-30 at 09 21 35

This video:

https://user-images.githubusercontent.com/5938143/210096936-2a9d0df9-4c6b-4de2-8301-6a818c113667.mp4

I sent it from webapp, here is the pub:

{"pub":{"id":"111320","topic":"grpOLsj5Xtvy3s","noecho":true,"head":{"mime":"text/x-drafty"},
"content":{"txt":" ","ent":[{"tp":"VD","data":{"mime":"video/mp4","ref":"/v0/file/s/Gpb-hpNXius.m4v",
"preview":"<26456, bytes: /9j/4AAQSkZJ...WV9JcV9aZ//Z>","width":576,"height":240,"duration":36566,
"name":"WhatsApp Video 2022-12-12 at 08.34.31.mp4","size":3360360}}],
"fmt":[{"len":1}]}},"extra":{"attachments":["/v0/file/s/Gpb-hpNXius.m4v"]}}
or-else commented 1 year ago

BTW unrelated: there is a bug in downloading attachments. If the attached file was uploaded and was removed (link is 404), the download still appears to work but it saves the json {ctrl code=404}.

or-else commented 1 year ago

If not too hard, I would increase the contrast of the [PLAY] button (make triangle white?):

Screenshot 2022-12-30 at 09 34 53
or-else commented 1 year ago

The share button in the upper right corner appears to do nothing:

Screenshot 2022-12-30 at 09 36 56
or-else commented 1 year ago

Landscape video sent from iPhone also appears as portrait on iPhone. It's shown correctly in webapp.

Sending is a bit confusing because the outgoing message does not appear until the upload is finished. The app should show a placeholder message, like in the web and android. Upload could take long time.

or-else commented 1 year ago

I would move duration to the left, otherwise it's a bit confusing because it's too close to the message timestamp:

Screenshot 2022-12-30 at 10 06 03

I would also add translucent darkening background under the duration. Video background could be white.

or-else commented 1 year ago

Sending video has two steps:

  1. Pick video in iOS UI
  2. Preview picked video with an option to add title in Tinode UI.

I don't think video should autoplay in step 2.

or-else commented 1 year ago

Video playback needs a mute button.

or-else commented 1 year ago

When you send a video with preview and both preview and video are sent by reference, only one reference is included into extra, like "extra":{"attachments":["/v0/file/s/Gpb-hpNXius.m4v"]}. The other file is quickly garbage-collected.

or-else commented 1 year ago

Wrong aspect ratio in video preview in reply:

Screenshot 2022-12-30 at 19 20 15
or-else commented 1 year ago

When forwarding video, preview is missing:

Screenshot 2022-12-30 at 19 22 32

This could be a side effect of "extra":{"attachments":["/v0/file/s/Gpb-hpNXius.m4v"]}

or-else commented 1 year ago

Video forwarded as square:

Screenshot 2022-12-30 at 19 23 36
or-else commented 1 year ago

When video is too small the duration and the play button are missing.

or-else commented 1 year ago

This is probably a more general problem with replies, but when the file name is too long, the quoted text wraps:

Screenshot 2022-12-30 at 20 00 06
aforge commented 1 year ago

Landscape video is not displayed correctly:

Screenshot 2022-12-30 at 09 21 35

This video:

WhatsApp.Video.2022-12-12.at.08.34.31.mp4 I sent it from webapp, here is the pub:

{"pub":{"id":"111320","topic":"grpOLsj5Xtvy3s","noecho":true,"head":{"mime":"text/x-drafty"},
"content":{"txt":" ","ent":[{"tp":"VD","data":{"mime":"video/mp4","ref":"/v0/file/s/Gpb-hpNXius.m4v",
"preview":"<26456, bytes: /9j/4AAQSkZJ...WV9JcV9aZ//Z>","width":576,"height":240,"duration":36566,
"name":"WhatsApp Video 2022-12-12 at 08.34.31.mp4","size":3360360}}],
"fmt":[{"len":1}]}},"extra":{"attachments":["/v0/file/s/Gpb-hpNXius.m4v"]}}

Done.

aforge commented 1 year ago

If not too hard, I would increase the contrast of the [PLAY] button (make triangle white?):

Screenshot 2022-12-30 at 09 34 53

Done.

aforge commented 1 year ago

The share button in the upper right corner appears to do nothing:

Screenshot 2022-12-30 at 09 36 56

Done.

aforge commented 1 year ago

Done.

aforge commented 1 year ago

Done. Video previews are presented in paused mode now.

aforge commented 1 year ago

Fixed. Turned out entity attribute stripping.

aforge commented 1 year ago

Video forwarded as square:

Screenshot 2022-12-30 at 19 23 36

Fixed.

or-else commented 1 year ago

Unable to play video if poster (preview) is missing or invalid.

Screenshot 2023-01-02 at 11 48 02

Here is the entity:

{data: { 
height: 240, 
mime: "video/mp4", 
name: "WhatsApp Video 2022-12-12 at 08.34.31.mp4", 
ref: "/v0/file/s/DM_5zpBAUVw.m4v", 
size: 3360360, 
width: 576 }}
aforge commented 1 year ago

Unable to play video if poster (preview) is missing or invalid.

Screenshot 2023-01-02 at 11 48 02

Here is the entity:

{data: { 
height: 240, 
mime: "video/mp4", 
name: "WhatsApp Video 2022-12-12 at 08.34.31.mp4", 
ref: "/v0/file/s/DM_5zpBAUVw.m4v", 
size: 3360360, 
width: 576 }}

Strange. I can't reproduce. Can you elaborate? Does clicking on the poster placeholder do nothing? Or does it open the video player that won't play the video?

or-else commented 1 year ago

When sending video, the send button is much smaller than normal:

Screenshot 2023-01-02 at 12 50 30
or-else commented 1 year ago

Canceling video upload results in a scary error message:

Screenshot 2023-01-02 at 12 53 50
or-else commented 1 year ago

When opening a video message, it's fine to autoplay. Autoplay should not be on when previewing before sending. It shoud autoplay when viewing received videos.

or-else commented 1 year ago

This bug is not fixed:

{"pub":{
  "id":"78785",
  "content":{
    "txt":"  This is a test",
    "fmt":[{"at":0,"len":1,"key":0},{"at":1,"len":1,"tp":"BR"}],
    "ent":[{"data":{
      "preref":"/v0/file/s/ARUc-ynHLcw.png",
      "ref":"/v0/file/s/9ytwKLpUxjo.bin",
      "height":200,
      "mime":"video/quicktime",
      "width":480,
      "size":3515235,
      "duration":36533,
      "name":"trim.A83D4CD7-D9C9-47F0-8F9B-C44EA2318AA5.MOV",
      "premime":"image/png"
    },
    "tp":"VD"
  }
]
},
"topic":"usrNUSFF-HGjYE",
"noecho":true,
"head":{"mime":"text/x-drafty"}},
"extra":{"attachments":["/v0/file/s/9ytwKLpUxjo.bin"]}
}

You are sending two attachments: "preref":"/v0/file/s/ARUc-ynHLcw.png", "ref":"/v0/file/s/9ytwKLpUxjo.bin", but only one is listed in "attachments":["/v0/file/s/9ytwKLpUxjo.bin"]. The /v0/file/s/ARUc-ynHLcw.png will be garbage collected. It should be "attachments":["/v0/file/s/9ytwKLpUxjo.bin","/v0/file/s/ARUc-ynHLcw.png"]

or-else commented 1 year ago

The mute button works with ~1 second delay.

aforge commented 1 year ago

Fixed as discussed.

aforge commented 1 year ago

When sending video, the send button is much smaller than normal:

Screenshot 2023-01-02 at 12 50 30

Fixed. Some minor differences between SendMessageBar and SendImageBar storyboards.

aforge commented 1 year ago

Canceling video upload results in a scary error message:

Screenshot 2023-01-02 at 12 53 50

Removed error message display for user-initiated cancel.

aforge commented 1 year ago

When opening a video message, it's fine to autoplay. Autoplay should not be on when previewing before sending. It shoud autoplay when viewing received videos.

Done. Autoplay enabled for previewing messages.

aforge commented 1 year ago

This bug is not fixed:

{"pub":{
  "id":"78785",
  "content":{
    "txt":"  This is a test",
    "fmt":[{"at":0,"len":1,"key":0},{"at":1,"len":1,"tp":"BR"}],
    "ent":[{"data":{
      "preref":"/v0/file/s/ARUc-ynHLcw.png",
      "ref":"/v0/file/s/9ytwKLpUxjo.bin",
      "height":200,
      "mime":"video/quicktime",
      "width":480,
      "size":3515235,
      "duration":36533,
      "name":"trim.A83D4CD7-D9C9-47F0-8F9B-C44EA2318AA5.MOV",
      "premime":"image/png"
    },
    "tp":"VD"
  }
]
},
"topic":"usrNUSFF-HGjYE",
"noecho":true,
"head":{"mime":"text/x-drafty"}},
"extra":{"attachments":["/v0/file/s/9ytwKLpUxjo.bin"]}
}

You are sending two attachments: "preref":"/v0/file/s/ARUc-ynHLcw.png", "ref":"/v0/file/s/9ytwKLpUxjo.bin", but only one is listed in "attachments":["/v0/file/s/9ytwKLpUxjo.bin"]. The /v0/file/s/ARUc-ynHLcw.png will be garbage collected. It should be "attachments":["/v0/file/s/9ytwKLpUxjo.bin","/v0/file/s/ARUc-ynHLcw.png"]

Overlooked it. Thanks for reminding.

aforge commented 1 year ago

It is a VLC issue with no clear solution. I'll play with potential solutions suggested on the internet... If it doesn't help, we'll have to invent something here to take care of it. (I think I briefly mentioned this issue a couple of days back when we talked f2f).

or-else commented 1 year ago

Re: mute with a delay. Yes, it looks like a VLC issue. It's not critical, let's forget about it.

or-else commented 1 year ago

The share button in the upper right corner on the video preview can be pressed multiple times and every click results in a new bottom sheet.

or-else commented 1 year ago

Otherwise looks good to me. Thanks.

or-else commented 1 year ago

Minor nitpick:

Screenshot 2023-01-02 at 15 43 26

I would add spaces on the left and right to make it prettier.

aforge commented 1 year ago

Done.

aforge commented 1 year ago

Yeah, this one will need a bit of work to do properly. I'll do it as a follow-up tomorrow.