OSMF Smoothing Video on MediaElement – MediaFactory

At first I couldn’t think of how to apply smoothing to OSMF’s MediaElement when using the MediaFactory. One day later it hit me and I wanted to share. First thing you need to do is the check if the MediaElement is a VideoElement. Once we know it is a VideoElement we can let the compiler know it is a VideoElement and apply smoothing to the video.

var mediaFactory:MediaFactory =  new DefaultMediaFactory();
mediaElement = mediaFactory.createMediaElement(new StreamingURLResource(httpStreaming));

if(mediaElement is VideoElement)
{
(mediaElement as VideoElement).smoothing = true;
}

Leave a Reply