skip to Main Content

Xcode – SharingMusicPlayer.swift:12:79: Cannot convert value of type 'AVAudioPlayer.Type' to expected argument type 'AVAudioPlayer'

This is what I have in my singleton: import AVFoundation import Foundation class SharingMusicPlayer { static let sharingMusicPlayer = SharingMusicPlayer(backgroundMusicPlayer: AVAudioPlayer) let backgroundMusicPlayer : AVAudioPlayer private init(backgroundMusicPlayer: AVAudioPlayer) { self.backgroundMusicPlayer = backgroundMusicPlayer } func playMusic() { // open and play…

VIEW QUESTION

Android Studio – Can I make one function for all activity, to play, pause music

First Activity package com.example.birthdaywish; import androidx.appcompat.app.AppCompatActivity; import android.content.Context; import android.content.Intent; import android.media.MediaPlayer; import android.os.Bundle; import android.text.Editable; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.Toast; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } public…

VIEW QUESTION
Back To Top
Search