Review isPlayable() function #1590

Closed
opened 2018-06-13 19:18:55 +02:00 by tzarebczan · 9 comments
tzarebczan commented 2018-06-13 19:18:55 +02:00 (Migrated from github.com)

The Issue

Related to work done for https://github.com/lbryio/lbry-app/issues/1503

Some zip files (and possibly other formats), like the one at lbry://ScreenToGif12-50-45590#f8866c585e39d26f87039547e0c51b2614280eb0, show up as playable files (show Play button and then say "this file cannot be played"). We should review the isPlayable function to ensure it only shows play on valid media types (reference render media?).

System Configuration

  • LBRY Daemon version:
  • LBRY App version:
  • LBRY Installation ID:
  • Operating system:

Anything Else

Screenshots

<!-- Thanks for reporting an issue to LBRY and helping us improve! To make it possible for us to help you, please fill out below information carefully. Before reporting any issues, please make sure that you're using the latest version. - App releases: https://github.com/lbryio/lbry-app/releases - Standalone daemon: https://github.com/lbryio/lbry/releases We are also available on live chat at https://chat.lbry.io --> ## The Issue Related to work done for https://github.com/lbryio/lbry-app/issues/1503 Some zip files (and possibly other formats), like the one at lbry://ScreenToGif12-50-45590#f8866c585e39d26f87039547e0c51b2614280eb0, show up as playable files (show Play button and then say "this file cannot be played"). We should review the isPlayable function to ensure it only shows play on valid media types (reference render media?). ## System Configuration <!-- For the app, this info is in the About section at the bottom of the Help page. You can include a screenshot instead of typing it out --> <!-- For the daemon, run: curl 'http://localhost:5279' --data '{"method":"version"}' and include the full output --> - LBRY Daemon version: - LBRY App version: - LBRY Installation ID: - Operating system: ## Anything Else <!-- Include anything else that does not fit into the above sections --> ## Screenshots <!-- If a screenshot would help explain the bug, please include one or two here -->
tzarebczan commented 2018-06-13 19:30:29 +02:00 (Migrated from github.com)

Render media: https://github.com/feross/render-media

This is a powerful package that handles many file types like video (.mp4, .webm, .m4v, etc.), audio (.m4a, .mp3, .wav, etc.), images (.jpg, .gif, .png, etc.), and other file formats (.pdf, .md, .txt, etc.).

Render media: https://github.com/feross/render-media This is a powerful package that handles many file types like video (.mp4, .webm, .m4v, etc.), audio (.m4a, .mp3, .wav, etc.), images (.jpg, .gif, .png, etc.), and other file formats (.pdf, .md, .txt, etc.).
tzarebczan commented 2018-06-13 19:48:49 +02:00 (Migrated from github.com)

Sample files:
Text: lbry://textfile#e39b887ff0c06438f673067f94243b33bde44518
HTML: lbry://htmlfile#67f030c9c658d2797ddfa08ee5657e6896759044

Sample files: Text: lbry://textfile#e39b887ff0c06438f673067f94243b33bde44518 HTML: lbry://htmlfile#67f030c9c658d2797ddfa08ee5657e6896759044
tzarebczan commented 2018-06-16 17:28:04 +02:00 (Migrated from github.com)

The above was only happening with https://github.com/lbryio/lbry-app/pull/1589 that didn't end up getting merged. Will keep open as we should investigate this line change: https://github.com/lbryio/lbry-app/pull/1589/commits/daeb02cd3777c5aa7ed4ef46656719f3b8a0e10d#diff-df116a02bf8da7997de2245267390707R118

The above was only happening with https://github.com/lbryio/lbry-app/pull/1589 that didn't end up getting merged. Will keep open as we should investigate this line change: https://github.com/lbryio/lbry-app/pull/1589/commits/daeb02cd3777c5aa7ed4ef46656719f3b8a0e10d#diff-df116a02bf8da7997de2245267390707R118
tiger5226 commented 2018-06-17 08:15:53 +02:00 (Migrated from github.com)

the default mime.json has .zip in it. So wouldn't that find a match if we passed in .zip?
Instead of trying to find in the mime set, we should instead check against MEDIASOURCE_EXTS which should only give us audio/video formats to make the rest not playable. However, we can't because it is not exported.

the default [mime.json](https://github.com/feross/render-media/blob/master/lib/mime.json#L80) has .zip in it. So wouldn't that find a match if we passed in .zip? Instead of trying to find in the mime set, we should instead check against [MEDIASOURCE_EXTS](https://github.com/feross/render-media/blob/master/index.js#L30) which should only give us audio/video formats to make the rest not playable. However, we can't because it is not exported.
tiger5226 commented 2018-06-17 08:46:38 +02:00 (Migrated from github.com)

fixed with https://github.com/lbryio/lbry-app/pull/1623

We just need to compare mediatype and only allow video and audio to be playable.

fixed with https://github.com/lbryio/lbry-app/pull/1623 We just need to compare mediatype and only allow video and audio to be playable.
tzarebczan commented 2018-06-18 18:39:41 +02:00 (Migrated from github.com)

Reverting the above PR since it doesn't take into account image types.

Reverting the above PR since it doesn't take into account image types.
btzr-io commented 2018-06-18 18:55:07 +02:00 (Migrated from github.com)

Also text, 3D-files, e-books

Also `text`, `3D-files`, `e-books`
tzarebczan commented 2018-07-12 06:17:57 +02:00 (Migrated from github.com)

@btzr-io lbry://mpgfile#077ec523f7a6950476cd071d3190228e564b4472 shows play for an mpg file. https://github.com/sinabio/Eleven - old.

markdown (shows viewable) - lbry://mdfile#24e737e03df62930ac4bd44151c818b3933a0381 - should be supported in render-media

@btzr-io lbry://mpgfile#077ec523f7a6950476cd071d3190228e564b4472 shows play for an mpg file. https://github.com/sinabio/Eleven - old. markdown (shows viewable) - lbry://mdfile#24e737e03df62930ac4bd44151c818b3933a0381 - should be supported in render-media
neb-b commented 2018-10-16 20:22:09 +02:00 (Migrated from github.com)

I think we can close this. We properly show the view button.

I think we can close this. We properly show the view button.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
LBRYCommunity/lbry-desktop#1590
No description provided.