Skip to content

Commit

Permalink
Merge pull request #318 from 10up/develop
Browse files Browse the repository at this point in the history
2.8.2 Release
  • Loading branch information
oscarssanchez authored Mar 16, 2023
2 parents 8c89fc2 + 760ad88 commit f56e925
Show file tree
Hide file tree
Showing 25 changed files with 14,119 additions and 295 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
- name: Install dependencies
run: npm install
run: npm ci
- name: Composer (optional)
run: composer install
continue-on-error: true
Expand All @@ -40,3 +40,7 @@ jobs:
run: npm run env:start
- name: Test
run: npm run cypress:run
env:
BRIGHTCOVE_ACCOUNT_ID: ${{ secrets.BRIGHTCOVE_ACCOUNT_ID }}
BRIGHTCOVE_CLIENT_ID: ${{ secrets.BRIGHTCOVE_CLIENT_ID }}
BRIGHTCOVE_CLIENT_SECRET: ${{ secrets.BRIGHTCOVE_CLIENT_SECRET }}
Binary file added .wordpress-org/screenshot-15.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file, per [the Ke

## [Unreleased] - TBD

## [2.8.2] - 2022-03-16

### Fixed
- Fixed plays in line not working with iFrame elements. Props [@oscarssanchez](https://github.com/oscarssanchez) and [@felipeelia](https://github.com/felipeelia), via [#313](https://github.com/10up/brightcove-video-connect/pull/313).
- Fixed autplay not working with Brightcove Player 7. Props [@oscarssanchez](https://github.com/oscarssanchez) and [@felipeelia](https://github.com/felipeelia), via [#314](https://github.com/10up/brightcove-video-connect/pull/314).
- Fixed link to authentication API docs. Props [@oscarssanchez](https://github.com/oscarssanchez) and [@felipeelia](https://github.com/felipeelia), via [#315](https://github.com/10up/brightcove-video-connect/pull/315).

## [2.8.1] - 2022-12-13

### Fixed
Expand Down Expand Up @@ -404,6 +411,7 @@ All notable changes to this project will be documented in this file, per [the Ke
- First release

[Unreleased]: https://github.com/10up/brightcove-video-connect/compare/master...develop
[2.8.2]: https://github.com/10up/brightcove-video-connect/compare/2.8.1...2.8.2
[2.8.1]: https://github.com/10up/brightcove-video-connect/compare/2.8.0...2.8.1
[2.8.0]: https://github.com/10up/brightcove-video-connect/compare/2.7.0...2.8.0
[2.7.0]: https://github.com/10up/brightcove-video-connect/compare/2.6.1...2.7.0
Expand Down
25 changes: 25 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Contributing and Maintaining

The following is a set of instructions for our maintenance and release process.

### Pull requests

Pull requests represent a proposed solution to a specified problem. They should always reference an issue that describes the problem and contains discussion about the problem itself. Discussion on pull requests should be limited to the pull request itself, i.e. code review.

For more on how 10up writes and manages code, check out our [10up Engineering Best Practices](https://10up.github.io/Engineering-Best-Practices/).

## Workflow

The `develop` branch is the development branch which means it contains the next version to be released. `master` contains the corresponding stable development version. Always branch off the `develop` branch and open up PRs against `develop`.

## Release instructions
1. Create a new branch following the format `release/x.y.z`
2. Changelog: Add/update the changelog in `CHANGELOG.md` and `readme.txt`, ensuring to link the [X.Y.Z] release reference in the footer of `CHANGELOG.md` (e.g., https://github.com/10up/brightcove-video-connect/compare/X.Y.Z-1...X.Y.Z)
3. Update the plugin version in `readme.txt`, `package.json`, `brightcove-video-connect.php` in plugin version and `BRIGHTCOVE_VERSION` constant
4. If applicable, bump the `tested up to` field in `readme.txt`
5. Run `npm run build` to generate updated translation files
6. Commit your changes and open a PR to `develop`
7. Once changes are merged, open a PR from `develop` to `master`
8. Once changes are merged, draft a new release https://github.com/10up/brightcove-video-connect/releases/new selecting as target `master`
9. Check the deploy to WordPres.org GitHub action ran correctly https://github.com/10up/brightcove-video-connect/actions
10. Verify the WordPress.org repository is updated. This may take a few minutes
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ http://httpd.apache.org/docs/current/mod/core.html#limitrequestbody (LimitReques
14. Selecting a playlist to show the details on the sidebar.
![](/.wordpress-org/screenshot-14.png)

15. Brightcove Block and Block Settings.
![](/.wordpress-org/screenshot-15.png)

## Audio Track Language Detection

The plugin has the ability to auto determine audio track language detection if the option has been enabled, based on the user browser language.
Expand Down
1 change: 0 additions & 1 deletion assets/js/bc-status.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 21 additions & 4 deletions assets/js/brightcove-admin.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion assets/js/brightcove-admin.js.map

Large diffs are not rendered by default.

11 changes: 2 additions & 9 deletions assets/js/brightcove-admin.min.js

Large diffs are not rendered by default.

56 changes: 36 additions & 20 deletions assets/js/src/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,28 @@
},
});

const muteField = el(components.CheckboxControl, {
label: __('Mute', 'brightcove'),
checked: mute !== '' || autoplay !== '',
onChange: function (value) {
props.setAttributes({
...props.attributes,
mute: value && 'muted',
});
},
});

const playsinlineField = el(components.CheckboxControl, {
label: __('Plays in line', 'brightcove'),
checked: playsinline !== '' || autoplay !== '',
onChange: function (value) {
props.setAttributes({
...props.attributes,
playsinline: value && 'playsinline',
});
},
});

const embedStyleField = el(components.RadioControl, {
label: __('Embed Style', 'brightcove'),
selected: embed,
Expand Down Expand Up @@ -462,31 +484,25 @@
props.setAttributes({
...props.attributes,
autoplay: value && 'autoplay',
});
},
}),
!isExperience &&
el(components.CheckboxControl, {
label: __('Mute', 'brightcove'),
checked: mute,
onChange: function (value) {
props.setAttributes({
...props.attributes,
mute: value && 'muted',
});
},
}),
!isExperience &&
el(components.CheckboxControl, {
label: __('Plays in line', 'brightcove'),
checked: playsinline,
onChange: function (value) {
props.setAttributes({
...props.attributes,
playsinline: value && 'playsinline',
});
},
}),
!isExperience && autoplay === 'autoplay'
? el(
components.Disabled,
{ style: { marginBottom: '24px' } },
muteField,
)
: muteField,
!isExperience && autoplay === 'autoplay'
? el(
components.Disabled,
{ style: { marginBottom: '24px' } },
playsinlineField,
)
: playsinlineField,
!playlistId &&
!isExperience &&
el(components.CheckboxControl, {
Expand Down
25 changes: 21 additions & 4 deletions assets/js/src/views/media-details.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ var MediaDetailsView = BrightcoveView.extend({
'click .brightcove.back.button': 'triggerCancelPreviewMedia',
'click .playlist-details input[name="embed-style"]': 'togglePlaylistSizing',
'change #aspect-ratio': 'toggleUnits',
'change #autoplay': 'toggleAutoplay',
'change #pictureinpicture': 'toggleIframe',
'change #languagedetection': 'toggleIframe',
'change .experience-details input[name="sizing"],.experience-details input[name="embed-style"]':
Expand Down Expand Up @@ -89,6 +90,21 @@ var MediaDetailsView = BrightcoveView.extend({
}
},

toggleAutoplay: function (event) {
return $('#autoplay').is(':checked')
? this.toggleAutoplayOptions(true)
: this.toggleAutoplayOptions(false);
},

toggleAutoplayOptions: function (value) {
var $playsinline = $('#playsinline'),
$mute = $('#mute');
$playsinline.prop('checked', value);
$playsinline.prop('disabled', value);
$mute.prop('checked', value);
$mute.prop('disabled', value);
},

toggleExperienceUnits: function (event) {
var $sizingField = $('input[name="sizing"]:checked');
var $sizing = $sizingField.val();
Expand Down Expand Up @@ -139,11 +155,11 @@ var MediaDetailsView = BrightcoveView.extend({
accountId = this.model.get('account_id').replace(/\D/g, ''),
playerId = $('#video-player').val(),
autoplay = $('#autoplay').is(':checked') ? 'autoplay' : '',
playsinline = $('#playsinline').is(':checked') ? 'playsinline' : '',
playsinline = $('#playsinline').is(':checked') || autoplay !== '' ? 'playsinline' : '',
mute = $('#mute').is(':checked') || autoplay !== '' ? 'muted' : '',
pictureinpicture = $('#pictureinpicture').is(':checked') ? 'pictureinpicture' : '',
languagedetection = $('#languagedetection').is(':checked') ? 'languagedetection' : '',
applicationId = $('#applicationid').val(),
mute = $('#mute').is(':checked') ? 'muted' : '',
embedStyle = $('input[name="embed-style"]:checked').val(),
sizing = $('input[name="sizing"]:checked').val(),
aspectRatio = $('#aspect-ratio').val(),
Expand Down Expand Up @@ -218,6 +234,7 @@ var MediaDetailsView = BrightcoveView.extend({

$('#shortcode').val(shortcode);
},

generateExperienceShortcode: function () {
var videoIds, accountId;
if (typeof this.model.get('id') !== 'undefined') {
Expand Down Expand Up @@ -282,8 +299,8 @@ var MediaDetailsView = BrightcoveView.extend({
accountId = this.model.get('account_id').replace(/\D/g, ''),
playerId = $('#video-player').val() || 'default',
autoplay = $('#autoplay').is(':checked') ? 'autoplay' : '',
playsinline = $('#playsinline').is(':checked') ? 'playsinline' : '',
mute = $('#mute').is(':checked') ? 'muted' : '',
playsinline = $('#playsinline').is(':checked') || autoplay !== '' ? 'playsinline' : '',
mute = $('#mute').is(':checked') || autoplay !== '' ? 'muted' : '',
embedStyle = $('input[name="embed-style"]:checked').val(),
sizing = $('input[name="sizing"]:checked').val(),
aspectRatio = $('#aspect-ratio').val(),
Expand Down
4 changes: 2 additions & 2 deletions brightcove-video-connect.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Brightcove Video Connect
* Plugin URI: https://wordpress.org/plugins/brightcove-video-connect/
* Description: A Brightcove™ Connector for WordPress that leverages enhanced APIs and Brightcove™ Capabilities
* Version: 2.8.1
* Version: 2.8.2
* Author: 10up
* Author URI: http://10up.com
* License: GPLv2+
Expand Down Expand Up @@ -31,7 +31,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 021.0.2301 USA
*/

define( 'BRIGHTCOVE_VERSION', '2.8.1' );
define( 'BRIGHTCOVE_VERSION', '2.8.2' );
define( 'BRIGHTCOVE_URL', plugin_dir_url( __FILE__ ) );
define( 'BRIGHTCOVE_PATH', dirname( __FILE__ ) . '/' );
define( 'BRIGHTCOVE_BASENAME', plugin_basename( __FILE__ ) );
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
"phpcompatibility/phpcompatibility-wp": "*"
},
"scripts": {
"lint": "phpcs .",
"lint-fix": "phpcbf ."
"lint": "phpcs brightcove-video-connect.php includes uninstall.php",
"lint-fix": "phpcbf brightcove-video-connect.php includes uninstall.php"
},
"config": {
"allow-plugins": {
Expand Down
7 changes: 4 additions & 3 deletions includes/admin/class-bc-admin-sources.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public function save_account() {
BC_Utility::delete_cache_item( 'brightcove_sync_videos' );

$this->notices[] = array(
'message' => sprintf(
'message' => sprintf(
'%s <a href="%s">%s</a> %s <a href="%s">%s</a>.',
esc_html__( 'Congratulations! Your credentials have been authenticated. You can now ', 'brightcove' ),
admin_url( 'admin.php?page=page-brightcove-videos' ),
Expand All @@ -183,7 +183,8 @@ public function save_account() {
admin_url( 'admin.php?page=brightcove-sources' ),
esc_html__( 'add another Brightcove account', 'brightcove' )
),
'type' => 'updated',
'type' => 'updated',
'identifier' => 'successfully-configured-brightcove',
);

BC_Utility::delete_cache_item( '*' );
Expand Down Expand Up @@ -275,7 +276,7 @@ class="regular-text" required="required" value="<?php echo esc_attr( $source_nam
<br>
<?php
echo sprintf(
'%s <a target="_blank" href="https://support.brightcove.com/managing-api-authentication-credentials">%s</a>.',
'%s <a target="_blank" href="https://apis.support.brightcove.com/general/managing-api-authentication-credentials.html">%s</a>.',
esc_html__( 'For more details on the different API permissions or settings below, please check out our documentation at', 'brightcove' ),
esc_html__( 'Managing API Authentication Credentials', 'brightcove' )
);
Expand Down
9 changes: 5 additions & 4 deletions includes/class-bc-setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public static function action_init_all() {
'language_detection' => array(
'type' => 'string',
),
'application_id' => array(
'application_id' => array(
'type' => 'string',
),
'height' => array(
Expand Down Expand Up @@ -371,7 +371,7 @@ public static function admin_enqueue_scripts() {
'str_selectfile' => esc_html__( 'Select File', 'brightcove' ),
'str_useremote' => esc_html__( 'Use a remote file instead', 'brightcove' ),
'str_apifailure' => esc_html__( "Sorry! We weren't able to reach the Brightcove API even after trying a few times. Please try refreshing the page.", 'brightcove' ),
'posts_per_page' => absint( apply_filters( 'brightcove_posts_per_page', 100 ) ),
'posts_per_page' => absint( apply_filters( 'brightcove_posts_per_page', 100 ) ), // phpcs:ignore WordPress.WP.PostsPerPage.posts_per_page_posts_per_page
);

wp_register_script( 'brightcove', '//sadmin.brightcove.com/js/BrightcoveExperiences.js', array(), BRIGHTCOVE_VERSION, false );
Expand Down Expand Up @@ -501,13 +501,14 @@ public static function bc_admin_notices() {
) {

$notices[] = array(
'message' => sprintf(
'message' => sprintf(
'%s <a href="%s"><strong>%s</strong></a>',
esc_html__( 'Please configure Brightcove settings from', 'brightcove' ),
esc_url( admin_url( 'admin.php?page=brightcove-sources' ) ),
esc_html__( 'here', 'brightcove' )
),
'type' => 'updated',
'type' => 'updated',
'identifier' => 'configure-brightcove',
);

}
Expand Down
Loading

0 comments on commit f56e925

Please sign in to comment.