Daniel wants to create the DigitalPlayer interface that should implement the Play() and Stop() methods to play or stop an mp3 or mp4 file.
He has already created the AudioPlayer and VideoPlayer structs, as well as the Play() and Stop() methods. Now you need to help Daniel with the following tasks:
- Create the
DigitalPlayerinterface with thePlay()andStop()methods; - Create the
playervariable of theDigitalPlayertype within themainfunction; - Make the
playervariable anAudioPlayeror aVideoPlayerdepending on the file extensionmp3ormp4; - Finally, call the
Play()andStop()methods on the previously createdplayer.