Skip to content

Commit 2f43e51

Browse files
committed
Video player add ogv and webm support
1 parent 8a1abb3 commit 2f43e51

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

extensions/ccui/uiwidgets/UIVideoPlayer.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,11 +257,20 @@ ccui.VideoPlayer.EventType = {
257257
};
258258

259259
(function(){
260+
/**
261+
* Some old browser only supports Theora encode video
262+
* But native does not support this encode,
263+
* so it is best to provide mp4 and webm or ogv file
264+
*/
260265
var dom = document.createElement("video");
261-
if(dom.canPlayType("video/ogg"))
266+
if(dom.canPlayType("video/ogg")){
262267
video._polyfill.canPlayType.push(".ogg");
268+
video._polyfill.canPlayType.push(".ogv");
269+
}
263270
if(dom.canPlayType("video/mp4"))
264271
video._polyfill.canPlayType.push(".mp4");
272+
if(dom.canPlayType("video/webm"))
273+
video._polyfill.canPlayType.push(".webm");
265274
})();
266275

267276
if(cc.sys.OS_IOS === cc.sys.os){

0 commit comments

Comments
 (0)