soundcloud

package
v0.0.0-...-e9c30ff Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewProvider

func NewProvider(apiHost, clientID, appVersion string) media.Provider

NewProvider returns a new SoundCloud track provider

Types

type APIPublisherMetadata

type APIPublisherMetadata struct {
	Artist        string `json:"artist"`
	ContainsMusic bool   `json:"contains_music"`
}

type APIResponse

type APIResponse struct {
	ArtworkURL        string               `json:"artwork_url"`
	Duration          int64                `json:"duration"`
	FullDuration      int64                `json:"full_duration"`
	EmbeddableBy      string               `json:"embeddable_by"`
	Kind              string               `json:"kind"`
	ID                int64                `json:"id"`
	MonetizationModel string               `json:"monetization_model"`
	PermalinkURL      string               `json:"permalink_url"`
	Policy            string               `json:"policy"`
	Public            bool                 `json:"public"`
	PublisherMetadata APIPublisherMetadata `json:"publisher_metadata"`
	Sharing           string               `json:"sharing"`
	Streamable        bool                 `json:"streamable"`
	Title             string               `json:"title"`
	User              APIUser              `json:"user"`
}

type APIUser

type APIUser struct {
	Username string `json:"username"`
	ID       int64  `json:"id"`
}

type TrackProvider

type TrackProvider struct {
	// contains filtered or unexported fields
}

TrackProvider provides SoundCloud track media

func (*TrackProvider) BasicMediaInfoFromPlayedMedia

func (s *TrackProvider) BasicMediaInfoFromPlayedMedia(playedMedia *types.PlayedMedia) (media.BasicInfo, error)

func (*TrackProvider) CanHandleRequestType

func (c *TrackProvider) CanHandleRequestType(mediaParameters proto.IsEnqueueMediaRequest_MediaInfo) bool

func (*TrackProvider) ContinueEnqueueRequest

func (c *TrackProvider) ContinueEnqueueRequest(ctx *transaction.WrappingContext, genericInfo media.InitialInfo, unskippable, concealed, anonymous,
	allowUnpopular, skipLengthChecks, skipDuplicationChecks bool) (media.EnqueueRequest, media.EnqueueRequestCreationResult, error)

func (*TrackProvider) SerializePlayedMediaMediaInfo

func (s *TrackProvider) SerializePlayedMediaMediaInfo(playedMedia *types.PlayedMedia) (proto.IsPlayedMedia_MediaInfo, error)

func (*TrackProvider) SerializeReceivedRewardMediaInfo

func (s *TrackProvider) SerializeReceivedRewardMediaInfo(playedMedia *types.PlayedMedia) (proto.IsReceivedReward_MediaInfo, error)

func (*TrackProvider) SerializeUserProfileResponseFeaturedMedia

func (s *TrackProvider) SerializeUserProfileResponseFeaturedMedia(playedMedia *types.PlayedMedia) (proto.IsUserProfileResponse_FeaturedMedia, error)

func (*TrackProvider) SetMediaQueue

func (c *TrackProvider) SetMediaQueue(mediaQueue media.MediaQueueStub)

func (*TrackProvider) TrackInfo

func (c *TrackProvider) TrackInfo(trackURL string) (*APIResponse, error)

func (*TrackProvider) UnmarshalQueueEntryJSON

func (s *TrackProvider) UnmarshalQueueEntryJSON(ctx context.Context, b []byte) (media.QueueEntry, bool, error)

Jump to

Keyboard shortcuts

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