VideoPlayer should accpet asset object (#2722)

This commit is contained in:
Jare Guo
2018-05-25 13:51:12 +08:00
committed by pandamicro
parent 112f8a4e9d
commit c951d8c620
+5 -2
View File
@@ -155,8 +155,11 @@ var VideoPlayer = cc.Class({
return this._clip;
},
set: function (value) {
if (typeof value !== 'string')
value = '';
if (typeof value === 'string') {
// backward compatibility since 1.10
cc.errorID(8401, 'cc.VideoPlayer', 'cc.Asset', 'Asset', 'cc.Asset', 'video');
value = { nativeUrl: value };
}
this._clip = value;
this._updateVideoSource();
},