adapter

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 11, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdvancedMediaPlayer

type AdvancedMediaPlayer interface {
	PlayVLC()
	PlayMP4()
}

type MP4Player

type MP4Player struct {
	FileName string
}

MP4Player 实现AdvancedMediaPlayer接口

func (*MP4Player) PlayMP4

func (mp *MP4Player) PlayMP4()

func (*MP4Player) PlayVLC

func (mp *MP4Player) PlayVLC()

type MediaPlayer

type MediaPlayer interface {
	Play(string)
}

type MediaPlayerAdapter

type MediaPlayerAdapter struct {
	//MediaType string
	MediaType string
}

创建adapter

func NewMediaPlayerAdapter

func NewMediaPlayerAdapter(mt string) *MediaPlayerAdapter

func (*MediaPlayerAdapter) Play

func (mpa *MediaPlayerAdapter) Play(fileName string)

type VLCPlayer

type VLCPlayer struct {
	FileName string
}

VLCPlayer 实现AdvancedMediaPlayer接口

func (*VLCPlayer) PlayMP4

func (vp *VLCPlayer) PlayMP4()

func (*VLCPlayer) PlayVLC

func (vp *VLCPlayer) PlayVLC()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL