Documentation
  • Introduction
  • Components
    • User Interface
      • Button
      • Checkbox
      • Date Picker
      • Floating Button
      • Image
      • Label
      • List Picker
      • List View
      • List View Image and Text
      • Notifier
      • Radio Button
      • Rating Bar
      • Slider
      • Surface View
      • Spinner
      • Switch
      • TextBox
      • Time Picker
      • Web Viewer
    • Layout
      • Horizontal Arrangement
      • Horizontal Scroll Arrangement
      • Space
      • Table Arrangement
      • Vertical Arrangement
      • Vertical Scroll Arrangement
    • Media
      • Audio Picker
      • Camcorder
      • Camera
      • Image Picker
      • Metadata
      • OCR
      • Player
      • QR Code
      • Sound
      • Sound Recorder
      • Speech Recognizer
      • Text To Speech
      • Video Player
      • Yandex Translate
    • Drawing and Animation
      • Ball
      • Canvas
      • Image Editor
      • Image Sprite
    • Sensors
      • Accelerometer
      • Barcode Scanner
      • Clock
      • Finger Print
      • Gravity Sensor
      • Gyroscope Sensor
      • Light Sensor
      • Location Sensor
      • Magnetic Field Sensor
      • NearField
      • Orientation Sensor
      • Pedometer
      • Pressure Sensor
      • Proximity Sensor
      • Sound Sensor
      • Temperature Sensor
    • Social
      • Contact Picker
      • Email Picker
      • Google Account Picker
      • Phone Call
      • Phone Number Picker
      • Sharing
      • Texting
      • Twitter
    • Storage
      • File
      • Firebase DB
      • Fusiontables Control
      • SQLite
      • Tiny DB
      • Tiny Web DB
    • Connectivity
      • Activity Starter
      • Bluetooth Admin
      • Bluetooth Client
      • Bluetooth Server
      • Download
      • Network
      • Web
      • WiFi
    • Google
      • Google Account Picker
      • Google Maps
      • Google Shortlink
    • LEGO Mindstorms
      • NXT Drive
      • NXT Color Sensor
      • NXT Light Sensor
      • NXT Sound Sensor
      • NXT Touch Sensor
      • NXT Ultrasonic Sensor
      • NXT Direct Commands
      • EV3 Motors
      • EV3 Color Sensor
      • EV3 Gyro Sensor
      • EV3 Touch Sensor
      • EV3 Ultrasonic Sensor
      • EV3 Sound
      • EV3 UI
      • EV3 Commands
    • Monetization
      • AdMob Interstitial
      • AdMob Banner
      • AdMob Rewarded Video
      • Billing
      • Leadbolt
    • Device
      • Audio
      • Device Tools
      • Wallpaper
      • Package
      • Screenshot
    • Experimental
      • Push Notifications
      • Cloud DB
      • Notification
  • Blocks
    • Control
    • Logic
    • Math
    • Text
    • Lists
    • Colors
    • Variables
    • Procedures
    • Screen
    • Any Component
  • Testing
    • Live Development
      • Via WiFi
      • Via USB
    • Makeroid Companion
  • Extensions
    • List of Extensions
    • Creating Extensions
  • Other
    • Backpack
    • Release Notes
      • Andromeda
      • Beta Versions
    • Resources
      • Concept Cards
    • Terms of Service
Powered by GitBook
On this page
  • Properties
  • IsPlaying
  • Loop
  • PlayOnlyInForeground
  • Source
  • Volume
  • Events
  • Completed()
  • OtherPlayerStarted()
  • Methods
  • Pause()
  • Start()
  • Stop()
  • Vibrate(number milliseconds)
  1. Components
  2. Media

Player

Multimedia component that plays audio and controls phone vibration. The name of a multimedia field is specified in the Source property, which can be set in the Designer or in the Blocks Editor. The length of time for a vibration is specified in the Blocks Editor in milliseconds (thousandths of a second).

For supported audio formats, see Android Supported Media Formats.

This component is best for long sound files, such as songs, while the Sound component is more efficient for short files, such as sound effects.

Properties

IsPlaying

Reports whether the media is playing

Loop

If true, the player will loop when it plays. Setting Loop while the player is playing will affect the current playing.

PlayOnlyInForeground

If true, the player will pause playing when leaving the current screen; if false (default option), the player continues playing whenever the current screen is displaying or not.

Source

Volume

Sets the volume to a number between 0 and 100

Events

Completed()

Indicates that the media has reached the end

OtherPlayerStarted()

This event is signaled when another player has started (and the current player is playing or paused, but not stopped).

Methods

Pause()

Suspends playing the media if it is playing.

Start()

Plays the media. If it was previously paused, the playing is resumed. If it was previously stopped, it starts from the beginning.

Stop()

Stops playing the media and seeks to the beginning of the song.

Vibrate(number milliseconds)

Vibrates for specified number of milliseconds.

PreviousOCRNextQR Code

Last updated 7 years ago