NovCTP - MediaPlayerSample
Hi,
Anyone have a sample on how to draw video in NovCTP.
I have the following at the momment but fails to play video just audio.
MediaPlayer
player;
public Window1(){
InitializeComponent();
player =newMediaPlayer();
MediaTimeline t =newMediaTimeline();
t.Source =newUri(@"Japan.wmv");
MediaClock c = t.CreateClock();
player.Clock = c;
}
protectedoverridevoid OnRender(DrawingContext drawingContext){
drawingContext.DrawVideo(player,newRect(RenderSize));
base.OnRender(drawingContext);
}kind regards,
Thanks for the advice. The domain is rather more complicated but your advice is noted; I will start to move that way. The real problem for me i think was the change in the mechanics of the media element. i used to be able to stream from a custom httplistener to the DrawingContext, now media player or element does not play the stream however WMP does [tears!] :D
The reason nothing is being drawing is likely because Window has a
default style with some child drawing a white background over the whole Window. You can use DrawVideo into a DrawingVisual, or create a customized control/UIElement and override its OnRender method with the one you have above.As for streaming from an http URL, it is expected to work. If not, it is likely not related to the code sample you have above.
Hmm, im doing on override OnRender here but i guess i can try again.
as for the streaming it probably me but
<MediaElement Source="C:\Inetpub\wwwroot\ImagineBlogger\2.asf"/> Works
<MediaElement Source="http://awebbermedia/imagineblogger/2.asf"/> Doesnt
Thank the lord!, i thought i was insane.
my boss wont fire me now, thanks