video

package
v1.7.25 Latest Latest
Warning

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

Go to latest
Published: May 16, 2021 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CurrentProgress

func CurrentProgress() time.Duration

CurrentProgress represents how long the video has been playing it will be useful eventually for choosing the exact right screenshot

func GetCurrentlyPlaying

func GetCurrentlyPlaying()

GetCurrentlyPlaying will use lsof to figure out which dashcam video is currently playing (seriously) TODO: consider making this return a video struct

Types

type Video

type Video struct {
	Id          int           `db:"id"`
	Slug        string        `db:"slug"`
	Lat         float64       `db:"lat"`
	Lng         float64       `db:"lng"`
	NextVid     sql.NullInt64 `db:"next_vid"`
	PrevVid     sql.NullInt64 `db:"prev_vid"`
	Flagged     bool          `db:"flagged"`
	State       string        `db:"state"`
	DateFilmed  time.Time     `db:"date_filmed"`
	DateCreated time.Time     `db:"date_created"`
}

Videos represent a video file containing dashcam footage

var CurrentlyPlaying Video

CurrentlyPlaying is the video that is currently playing

func FindRandomByState

func FindRandomByState(state string) (Video, error)

func LoadOrCreate

func LoadOrCreate(path string) (Video, error)

LoadOrCreate() will look up the video in the DB, or add it to the DB if it's not there yet

func (Video) DashStr

func (v Video) DashStr() string

a DashStr is the string we get from the dashcam an example file: 2018_0514_224801_013.MP4 an example dashstr: 2018_0514_224801_013 ex: 2018_0514_224801_013

func (Video) File

func (v Video) File() string

ex: 2018_0514_224801_013.MP4

func (Video) Location

func (v Video) Location() (float64, float64, error)

Location returns a lat/lng pair TODO: refactor out the error return value

func (Video) Next

func (v Video) Next() Video

Next() finds the next unflagged video TODO: should this be NextUnflagged? TODO: handle errors in here?

func (Video) Path

func (v Video) Path() string

ex: /Volumes/.../2018_0514_224801_013.MP4

func (Video) SetNextVid

func (v Video) SetNextVid(nextVid Video) error

func (Video) String

func (v Video) String() string

TODO: add color, include location/state/lat/lng? TODO: where else does this get used tho? ex: 2018_0514_224801_013_a_opt

Jump to

Keyboard shortcuts

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