Skip to content
Jonas Gossens edited this page Feb 7, 2019 · 11 revisions

This is a collection of media features. I.e. you can show image galleries with a lightbox function or you can make use of an image upload function.

chayns.openImage(urls, start)

The images specified in the url array is shown in gallery mode.

Parameter

  • urls : string[] - List of image urls.
  • start (optional) : int - If you're providing more than one image, you can specify which image to show at first.
chayns.openImage(['https://tobit.com/chayns/Content/img/chayns_intro.png'], 0);

chayns.uploadImage()

An Upload-Image-Dialog will be opened. The function allows to upload the image directly from the gallery or use the camera to take a photo. The picture is saved on a server for 24 hours and will be deleted afterwards. The callback-function returns the path of the image.

Result

  • url : string - The url to the image saved on our server.
chayns.uploadImage().then((data) => {
 chayns.dialog.alert('Uploaded image to.. ', JSON.stringify(data))
});

The video specified in the URL is shown in video mode.

Supported Platforms

  • Android
  • iOS
  • ChaynsWeb

Parameter

  • url : string - The url referring to the video to show.
chayns.openVideo('https://chayns.tobit.com/medien/locations/378/Videos/510486662298168_1042382722441890_1042382722441890.mp4');

The audio file specified in the URL will be played.

Supported Platforms

  • Android
  • iOS

Parameter

  • url : string - The url referring to the audio file.
  • playOnMute (optional) : boolean - The sound will be played even if the user device is muted.
chayns.playSound('https://archive.org/download/testmp3testfile/mpthreetest.mp3');