Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1322)

Unified Diff: ui/file_manager/video_player/js/cast/media_manager.js

Issue 537863002: Video Player: fix misc bugs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase & fix bugs Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/file_manager/video_player/js/cast/media_manager.js
diff --git a/ui/file_manager/video_player/js/cast/media_manager.js b/ui/file_manager/video_player/js/cast/media_manager.js
index c78a0d63bcac68422cf003222794ccd6312dc72c..16a118f582b5c75433f5dcb2f5a9759f8fbed9ac 100644
--- a/ui/file_manager/video_player/js/cast/media_manager.js
+++ b/ui/file_manager/video_player/js/cast/media_manager.js
@@ -102,15 +102,18 @@ MediaManager.prototype.getUrl = function() {
*/
MediaManager.prototype.getMime = function() {
if (this.cachedDriveProp_)
- return Promise.resolve(this.cachedDriveProp_.thumbnailUrl);
+ return Promise.resolve(this.cachedDriveProp_.contentMimeType || '');
return new Promise(function(fulfill, reject) {
chrome.fileBrowserPrivate.getEntryProperties(
[this.entry_.toURL()], fulfill);
}.bind(this)).then(function(props) {
- if (!props || !props[0] || !props[0].contentMimeType) {
- // TODO(yoshiki): Adds a logic to guess the mime.
+ if (!props || !props[0]) {
return Promise.reject('Mime fetch failed.');
+ } else if (!props[0].contentMimeType) {
+ // TODO(yoshiki): Adds a logic to guess the mime.
+ this.cachedDriveProp_ = props[0];
+ return '';
} else {
this.cachedDriveProp_ = props[0];
return props[0].contentMimeType;
@@ -125,18 +128,17 @@ MediaManager.prototype.getMime = function() {
*/
MediaManager.prototype.getThumbnail = function() {
if (this.cachedDriveProp_)
- return Promise.resolve(this.cachedDriveProp_.thumbnailUrl);
+ return Promise.resolve(this.cachedDriveProp_.thumbnailUrl || '');
return new Promise(function(fulfill, reject) {
chrome.fileBrowserPrivate.getEntryProperties(
[this.entry_.toURL()], fulfill);
}.bind(this)).then(function(props) {
- if (!props || !props[0] || !props[0].thumbnailUrl) {
- // TODO(yoshiki): Adds a logic to guess the mime.
+ if (!props || !props[0]) {
return Promise.reject('Thumbnail fetch failed.');
} else {
this.cachedDriveProp_ = props[0];
- return props[0].thumbnailUrl;
+ return props[0].thumbnailUrl || '';
}
}.bind(this));
};
« no previous file with comments | « ui/file_manager/video_player/js/cast/cast_video_element.js ('k') | ui/file_manager/video_player/js/media_controls.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698