2 * Ext JS Library 0.30
\r
3 * Copyright(c) 2006-2009, Ext JS, LLC.
\r
4 * licensing@extjs.com
\r
6 * http://extjs.com/license
\r
10 * @class Ext.air.VideoPanel
13 Ext.air.VideoPanel = Ext.extend(Ext.Panel, {
18 initComponent: function() {
19 var connection = new air.NetConnection();
20 connection.connect(null);
22 this.stream = new runtime.flash.net.NetStream(connection);
23 this.stream.client = {
24 onMetaData: Ext.emptyFn
27 Ext.air.VideoPanel.superclass.initComponent.call(this);
28 this.on('bodyresize', this.onVideoResize, this);
31 afterRender: function() {
32 Ext.air.VideoPanel.superclass.afterRender.call(this);
34 var box = this.body.getBox();
35 this.video = new air.Video(this.getInnerWidth(), this.getInnerHeight());
37 this.video.attachNetStream(this.stream);
38 this.stream.play(this.url);
40 nativeWindow.stage.addChild(this.video);
47 onVideoResize: function(pnl, w, h) {
48 if (this.video && this.autoResize) {
49 var iw = this.getInnerWidth();
50 var ih = this.getInnerHeight();
52 this.video.height = ih;
53 var xy = this.body.getXY();
54 if (xy[0] !== this.video.x) {
57 if (xy[1] !== this.video.y) {
63 loadVideo: function(url) {
65 this.video.attachNetStream(this.stream);
66 this.stream.play(url);
70 Ext.reg('videopanel', Ext.air.VideoPanel);