Problem/Motivation

Autoplay works when the a video is primary focus of a page and the user expects to be watching it immediately, it's however annoying for a content admin for example to deal with autoplaying videos when administering the website.

Proposed resolution

I suggest this work entirely with permissions. If a user is assigned to a role with a permission such as "Bypass video autoplay", they never see an autoplay video regardless of the formatter settings.

Remaining tasks

Patch.

User interface changes

New permission.

API changes

None.

Data model changes

None.

Comments

Sam152 created an issue. See original summary.

sam152’s picture

Status: Active » Needs review
StatusFileSize
new10.07 KB

Initial work with the creation of a web test base to make web testing easier.

Status: Needs review » Needs work

The last submitted patch, 2: 2653244-role-based-autoplay-2.patch, failed testing.

The last submitted patch, 2: 2653244-role-based-autoplay-2.patch, failed testing.

The last submitted patch, 2: 2653244-role-based-autoplay-2.patch, failed testing.

The last submitted patch, 2: 2653244-role-based-autoplay-2.patch, failed testing.

The last submitted patch, 2: 2653244-role-based-autoplay-2.patch, failed testing.

sam152’s picture

Status: Needs work » Needs review
StatusFileSize
new1.74 KB
new11.63 KB

Status: Needs review » Needs work

The last submitted patch, 8: 2653244-role-based-autoplay-8.patch, failed testing.

benjy’s picture

+++ b/src/Plugin/Field/FieldFormatter/Video.php
@@ -134,10 +144,13 @@ class Video extends FormatterBase implements ContainerFactoryPluginInterface {
+  public function __construct($plugin_id, $plugin_definition, $field_definition, $settings, $label, $view_mode, $third_party_settings, ProviderManagerInterface $provider_manager, AccountProxyInterface $current_user) {

I think the correct type hint is AccountInterface?

sam152’s picture

Status: Needs work » Needs review
StatusFileSize
new11.61 KB
new1.95 KB
sam152’s picture

StatusFileSize
new11.63 KB

Status: Needs review » Needs work

The last submitted patch, 12: 2653244-role-based-autoplay-8-retest.patch, failed testing.

sam152’s picture

Status: Needs work » Needs review
StatusFileSize
new11.61 KB
sam152’s picture

sam152’s picture

Status: Needs review » Fixed

  • Sam152 committed f20310f on 8.x-1.x
    Issue #2653244 by Sam152, benjy: Allow role based override for the "...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

shobhit_juyal’s picture

This issue came again in latest branch 8.x-2.5