Skip to content

Commit ea6c3a5

Browse files
Merge pull request #278 from 10up/develop
Release 2.6.1
2 parents 438274b + d41cc1f commit ea6c3a5

File tree

10 files changed

+188
-154
lines changed

10 files changed

+188
-154
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file, per [the Ke
44

55
## [Unreleased] - TBD
66

7+
## [2.6.1] - 2022-06-07
8+
9+
### Fixed
10+
- Brightcove API changes break video edit view. Props [@oscarssanchez](https://github.com/oscarssanchez), and [@felipeelia](https://github.com/felipeelia), via [#276](https://github.com/10up/brightcove-video-connect/pull/276).
11+
712
## [2.6.0] - 2022-04-19
813

914
### Added
@@ -367,6 +372,7 @@ All notable changes to this project will be documented in this file, per [the Ke
367372
- First release
368373

369374
[Unreleased]: https://github.com/10up/brightcove-video-connect/compare/master...develop
375+
[2.6.1]: https://github.com/10up/brightcove-video-connect/compare/2.6.0...2.6.1
370376
[2.6.0]: https://github.com/10up/brightcove-video-connect/compare/2.5.2...2.6.0
371377
[2.5.2]: https://github.com/10up/brightcove-video-connect/compare/2.5.1...2.5.2
372378
[2.5.1]: https://github.com/10up/brightcove-video-connect/compare/2.5.0...2.5.1

assets/js/brightcove-admin.js

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/js/brightcove-admin.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/js/brightcove-admin.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/js/src/views/video-edit.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -581,6 +581,10 @@ var VideoEditView = BrightcoveView.extend({
581581
this.listenTo(wpbc.broadcast, 'insert:shortcode', this.insertShortcode);
582582
options = this.model.toJSON();
583583
options.folders = wpbc.preload.folders;
584+
585+
// Due to a change in the API response, text_tracks might not be defined if the video lacks text_tracks.
586+
options.text_tracks = options.text_tracks || [];
587+
584588
this.model.set('oldFolderId', options.folder_id);
585589

586590
// Render the model into the template

brightcove-video-connect.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Plugin Name: Brightcove Video Connect
44
* Plugin URI: https://wordpress.org/plugins/brightcove-video-connect/
55
* Description: A Brightcove™ Connector for WordPress that leverages enhanced APIs and Brightcove™ Capabilities
6-
* Version: 2.6.0
6+
* Version: 2.6.1
77
* Author: 10up
88
* Author URI: http://10up.com
99
* License: GPLv2+
@@ -29,7 +29,7 @@
2929
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 021.0.2301 USA
3030
*/
3131

32-
define( 'BRIGHTCOVE_VERSION', '2.6.0' );
32+
define( 'BRIGHTCOVE_VERSION', '2.6.1' );
3333
define( 'BRIGHTCOVE_URL', plugin_dir_url( __FILE__ ) );
3434
define( 'BRIGHTCOVE_PATH', dirname( __FILE__ ) . '/' );
3535
define( 'BRIGHTCOVE_BASENAME', plugin_basename( __FILE__ ) );

includes/admin/api/class-bc-admin-media-api.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1074,12 +1074,14 @@ protected function fetch_videos( $account_id, $count = 10 ) {
10741074
// Massage the text tracks
10751075
$result['captions'] = array();
10761076

1077-
foreach ( $result['text_tracks'] as $caption ) {
1078-
$result['captions'][] = array(
1079-
'source' => $caption['src'],
1080-
'language' => $caption['srclang'],
1081-
'label' => $caption['label'],
1082-
);
1077+
if ( ! empty( $result['text_tracks'] ) ) {
1078+
foreach ( $result['text_tracks'] as $caption ) {
1079+
$result['captions'][] = array(
1080+
'source' => $caption['src'],
1081+
'language' => $caption['srclang'],
1082+
'label' => $caption['label'],
1083+
);
1084+
}
10831085
}
10841086
}
10851087

0 commit comments

Comments
 (0)