From c951d8c620fc7d89a9e42fd77a75e69d72945ede Mon Sep 17 00:00:00 2001 From: Jare Guo Date: Fri, 25 May 2018 13:51:12 +0800 Subject: [PATCH] VideoPlayer should accpet asset object (#2722) --- cocos2d/core/components/CCVideoPlayer.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cocos2d/core/components/CCVideoPlayer.js b/cocos2d/core/components/CCVideoPlayer.js index 50e16995f9..13b9f972b5 100644 --- a/cocos2d/core/components/CCVideoPlayer.js +++ b/cocos2d/core/components/CCVideoPlayer.js @@ -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(); },