This guide explains how to use audio and video files in a project.
Using Audio Files
The Smartface let's you to play audio files in your application. There are 3 methods for audio files which are;
|playSound||Plays the specified sound media.|
|setSoundLevel||Sets sound level of the device. This action is used for setting the device sound levels.|
|stopSound||Stops all the playing sound media in the application.|
Here is a sample code for using Audio features of the Smartface as below ;
Using Video Files
A Video object is a video display control object which uses native video player. It can display both in embedded style and full screen style.
The Video object has some methods and properties to give more controls for users.
Changes property of the UI object with animation
Capture Thumbnail gets images from the running video objects according to time that you entered.
Sets the active focus to a specified focusable object.
Pauses the selected video. This actions pauses a video sequence. The video sequence is continued from its last position when re-activated with “Play Video” action.
Plays the specified video media. This action plays a video file when executed. The video media can be in type of .3GP or Real Media streaming.
It allows user to reset the specified object.
Stops the specified video media. This action stops the specified video and video playing position is rolled back to the start position.
Here is an example code which uses playVideo() method of the Video object:
Allows user to enter the link of video.
Allows you to specify control styles
Sets the enable feature of the selected object.
Specifies the height of the the selected object.
Allows you to enter initial play time.
Specifies the position of the left side of the selected object
Locks the position of the control in a contained object.
Locks the size of the video object so that its position won’t be changed during the design process.Checked:Locks the object.Unchecked:Unlocks the object.
Allows you to set scale modes which enable to scale of the video.
A reference name which is not displayed when the application is running. Set a logical name for each object, so you can easily identify later. You can not use small letters,space and punctuation marks except comma and full stop.
Specifies the position of the top of the selected object.
Sets the touch feature of the selected object.
Returns the type of the component in string.
Shows or hides the object.True:Enables the feature.
Specifies the width of the selected object.
Here is an example for initialPlaybackTime property of Video :
Creates action(s) that are run when the object is disappeared on the page.
Creates action(s) that are run when the object is appeared on the page.
Creates action(s) that are run when the object is touched from device’s screen.
Creates action(s) that are run when the touching is ended.