Postingan lainnya
Buku Ini Koding!
Baru!
Buku ini akan jadi teman perjalanan kamu belajar sampai dapat kerjaan di dunia programming!
Kelas Premium!
Belajar Javascript untuk website
Gunakan kupon "mulaijs" untuk diskon 75 ribu!
kenapa di ionic tidak bisa play lagu sementara di local bisa
kenapa ya kok di ionic tidak bisa play lagu padalan kalo aku coba di luar bisa
3 Jawaban:
Jawaban Terpilih
contoh code nya di tampilin coba
file index.html
PlayPauseStopMutetrue012345Current Time
Current Time: {{audio.currentTime | trackTime}}
Volumeprogrees
file app // Ionic Starter App
// angular.module is a global place for creating, registering and retrieving Angular modules // 'starter' is the name of this angular module example (also set in a attribute in index.html) // the 2nd parameter is an array of 'requires' angular.module('starter', ['ionic'])
.run(function($ionicPlatform) { $ionicPlatform.ready(function() { if(window.cordova && window.cordova.plugins.Keyboard) { // Hide the accessory bar by default (remove this to show the accessory bar above the keyboard // for form inputs) cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
// Don't remove this line unless you know what you are doing. It stops the viewport // from snapping when text inputs are focused. Ionic handles this internally for // a much nicer keyboard experience. cordova.plugins.Keyboard.disableScroll(true); } if(window.StatusBar) { StatusBar.styleDefault(); } }); }) var app = angular.module('myApp', ['ngAudio']);
app.controller("audioTest",function($scope,ngAudio){ $scope.audio = ngAudio.load("lagu.mp3"); $scope.playSound = function(){ $scope.audio.play(); } });