Spark VideoPlayer skinned for mobile

Flex 4.5.1 is awesome. The mobile components rock and with only a few exceptions – TextInput anyone? – they work great on Android and iOS. But there is one glaring component that has not yet been mobile optimized: the <s:VideoPlayer>. And when they say not mobile optimized they aren’t kidding. Hopefully we’ll get an update to the Flex sdk soon with a mobile optimized version but until then I’ve done a rough re-skinning of it so that you can at least use the UI controls.

You can download all of the skins here in this zip file.

Here’s the zip file contents:

  • skins
    • video
      • FullScreenBtnSkin.mxml
      • MuteButtonSkin.mxml
      • ScrubBarSkin.mxml
      • ScrubBarThumbSkin.mxml
      • ScrubBarTrackSkin.mxml
      • VideoPlayerSkin.mxml
      • VolumeBarSkin.mxml
      • VolumeBarThumbSkin.mxml
      • VolumeBarTrackSkin.mxml
      • fullscreen
        • FullScreenBtnSkin.mxml
        • ScrubBarSkin.mxml
        • VolumeBarSkin.mxml

I did as little customization of the original skin as I could. About the only thing that changes is that the UI controls have a height of 40 pixels – I think originally it was 27px which is way to small for fingers.

The hardest thing was updating the ScrubBarThumbSkin.mxml. It just took a little trial and error to get the <s:Path data=…> all sorted out.

If nothing else this should save you some time in customizing your own skin because you won’t have to track down all of the skin files – easy but tedious.

If you use this all you need to do is use the VideoPlayerSkin as the skin for your <s:VideoPlayer>

Fullscreen exorcism

While all of the skin files for the <s:VideoPlayer> are there I removed the fullscreen button from the VideoPlayerSkin file because it doesn’t seem to work correctly. It’s fine in portrait layout but switch to landscape and it falls to pieces. Here’s some screenshots below.

Standard layout - working

Here’s what happens when you go fullscreen

Fullscreen all frakked up

As best I can tell the <s:VideoPlayer> doesn’t understand the portrait/landscape code when going fullscreen. I traced through the VideoPlayer.as code for a bit to see if the fix might be easy – specific for iPad – and couldn’t come up with anything. And my client said to just remove the fullscreen to save time/money.