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

Fixing Media Player Behaviour #884

Merged
merged 3 commits into from
Feb 2, 2021
Merged

Conversation

mneuwert
Copy link
Contributor

@mneuwert mneuwert commented Jan 31, 2021

Description

Fix for an issue when playing multiple items in the same directory. If e.g. image item is the next one, multi media playback would stop.

Related Issue

n/a

Motivation and Context

User would like to play all audio-visual files in a row without interruption.

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@CLAassistant
Copy link

CLAassistant commented Jan 31, 2021

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Michael Neuwert seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@mneuwert mneuwert added the UX label Jan 31, 2021
@mneuwert mneuwert self-assigned this Jan 31, 2021
@mneuwert mneuwert added this to the 11.5.0-Current milestone Jan 31, 2021
@mneuwert mneuwert changed the base branch from master to milestone/11.5 January 31, 2021 00:11
@mneuwert mneuwert changed the title [WIP] Fixing Media Player Behaviour Fixing Media Player Behaviour Jan 31, 2021
@mneuwert
Copy link
Contributor Author

@michaelstingl I ensured that all media files are played continuously.. Everything else in current directory (pictures, documents) is filtered out. Don't think we should try to do special handling for pictures in scope of this change especially considering that playing media also does work when the app is in background (I think we discussed that may be we should sort of have a gallery mode in which we skip to the next item when picture was displayed for couple of seconds.. guess this would need significantly more work given current preview architecture).

@michaelstingl
Copy link
Contributor

@mneuwert okay, perfect 👍

Could be future option: Include images is auto-play.

@mneuwert
Copy link
Contributor Author

@mneuwert okay, perfect 👍

Could be future option: Include images is auto-play.

May be also separate it? Like if you open picture, then you just have pictures changed one after another? Not mixing pictures and audio / video files?

Comment on lines 24 to 34
extension OCItem {
var isPlayable: Bool {
guard let mime = self.mimeType else { return false }

guard let uti = UTTypeCreatePreferredIdentifierForTag(kUTTagClassMIMEType, mime as CFString, nil) else {
return false
}

return UTTypeConformsTo(uti.takeUnretainedValue(), kUTTypeAudiovisualContent)
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice new addition to the OCItem class.
We already have a OCItem+Extension. I think it makes sense to move this code into this class, because it is more discoverable there.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure, this is context specific extension.. so for me it was easier to have it closer to the context in which it is used

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this extension is also interesting for an upcoming shortcut extension. For that I the OCItem+Extension is a better place in my opinion.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved to the extension you mentioned.

@jesmrec
Copy link
Contributor

jesmrec commented Feb 2, 2021

Now, media files played in a row (audio & video). Other files, filtered.

Approved

@jesmrec jesmrec added the Approved by QA Approved by QA label Feb 2, 2021
@hosy hosy merged commit 1d52c23 into milestone/11.5 Feb 2, 2021
@delete-merged-branch delete-merged-branch bot deleted the fix/media_player_behavior branch February 2, 2021 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Approved by QA Approved by QA UX
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants