### Play a media

To play a media, make use of the JavaFX MediaView class.
The media could be a MP3 (sound) or MP4 (video)
More to find: http://docs.oracle.com/javafx/2/api/javafx/scene/media/MediaView.html
Example
This example uses a pane (Private paneMedia As Pane) defined using JavaFX builder
`Sub playMedia
Dim mp As MediaPlayer
Dim jo,mv As JavaObject
' Init the mediaplayer - the file could be mp3 or mp4
mp.Initialize("mp",File.geturi(File.DirApp,"test1.mp4"))
' Create a javafx mediaview
mv = jo.InitializeNewInstance("javafx.scene.media.MediaView",Array As Object(mp))
' Add the MediaView to the pane
paneMedia.AddNode(mv,0,0,paneMedia.Width,paneMedia.Height)
' To add the mediaview to the mainform rootpane, use
'MainForm.RootPane.AddNode(mv,0,0,MainForm.Width,MainForm.Height)
' Start playing - in case the media is not supported an error occurs
Try
mp.Play
Catch
Log(LastException.Message)
End Try
End Sub`

Changed: , Category: Media, File: T6C219M1606.htm, ID: 1606