From: fifth on 3 Sep 2009 06:00 I'm designing a web-embedded video player, my idea is that, 1. use VMR with windowless mode to render video. 2. use activex control window as VMR clipping window. Then, I have to resize control according to actual video resolution. Here's what I did, 1. read video file in, get its resolution; 2. set control size by use of SetControlSize(cx, cy) accordingly. But it never worked. The control size was always the size passed in by html. What should I do? BTW, I'm not sure that using activex control as VMR windowless clipping window is good idea, any other suggestion? Thanks. PS. I know this thread should fit mfc ole, but there's no people discussing.
From: Goran on 3 Sep 2009 08:37 On Sep 3, 12:00 pm, fifth <buddhist.ch...(a)gmail.com> wrote: > I'm designing a web-embedded video player, my idea is that, > 1. use VMR with windowless mode to render video. > 2. use activex control window as VMR clipping window. > > Then, I have to resize control according to actual video resolution. > Here's what I did, > 1. read video file in, get its resolution; > 2. set control size by use of SetControlSize(cx, cy) accordingly. > > But it never worked. The control size was always the size passed in by > html. > > What should I do? > > BTW, I'm not sure that using activex control as VMR windowless > clipping window is good idea, any other suggestion? > > Thanks. > > PS. > I know this thread should fit mfc ole, but there's no people > discussing. Without understanding much of what you're saying here, I'd say that the control size is decided by <object> tag, (width, height attributes) and you have no say in that from the control code. (It'd be a horrible design if ActiveX controls could nilly-willy reformat the HTML at runtime, wouldn't you think?) You should be, however, able to use a browser script inside your html to resize the <object> tag once you know desired size. Approaches that come to mind: hook into HTMLElement's onreadystatechange, or create an event in your control that you yourself fire when you first find out about video size. Use size you get either from the control or from your own event to resize <object> from your script. HTH, Goran.
From: fifth on 3 Sep 2009 21:33 On Sep 3, 8:37 pm, Goran <goran.pu...(a)gmail.com> wrote: > On Sep 3, 12:00 pm, fifth <buddhist.ch...(a)gmail.com> wrote: > > > > > > > I'm designing a web-embedded video player, my idea is that, > > 1. use VMR with windowless mode to render video. > > 2. use activex control window as VMR clipping window. > > > Then, I have to resize control according to actual video resolution. > > Here's what I did, > > 1. read video file in, get its resolution; > > 2. set control size by use of SetControlSize(cx, cy) accordingly. > > > But it never worked. The control size was always the size passed in by > > html. > > > What should I do? > > > BTW, I'm not sure that using activex control as VMR windowless > > clipping window is good idea, any other suggestion? > > > Thanks. > > > PS. > > I know this thread should fit mfc ole, but there's no people > > discussing. > > Without understanding much of what you're saying here, I'd say that > the control size is decided by <object> tag, (width, height > attributes) and you have no say in that from the control code. (It'd > be a horrible design if ActiveX controls could nilly-willy reformat > the HTML at runtime, wouldn't you think?) > > You should be, however, able to use a browser script inside your html > to resize the <object> tag once you know desired size. Approaches that > come to mind: hook into HTMLElement's onreadystatechange, or create an > event in your control that you yourself fire when you first find out > about video size. Use size you get either from the control or from > your own event to resize <object> from your script. > > HTH, > Goran.- Hide quoted text - > > - Show quoted text - Got your idea! Fire up an event to html when figure out video size and let javascript to resize! Really appreciated.
|
Pages: 1 Prev: Journey into Unicode Next: How to serialize Mfc template dialog class ? |