forked from adafruit/pi_video_looper
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add titles and fixed playlists * Pass directly a Movie object to VideoPlayer.play * Update config * Fix end time * Remove specific config keys which can go to extra_args * removed playlist type setting * fix for player breaking with no usb stick * Add titles and fixed playlists (adafruit#67) * Add titles and fixed playlists * v1.0.5 * Pass directly a Movie object to VideoPlayer.play * Update config * Fix end time * Remove specific config keys which can go to extra_args * Add font-size in extra_args * use play all the files if playlist file does not work out * v1.0.5 updated readme
- Loading branch information
1 parent
e045e42
commit a9d7501
Showing
9 changed files
with
161 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import os | ||
import re | ||
import urllib.parse | ||
|
||
from .model import Playlist, Movie | ||
|
||
|
||
def build_playlist_m3u(playlist_path: str): | ||
playlist_dirname = os.path.dirname(playlist_path) | ||
movies = [] | ||
|
||
title = None | ||
|
||
with open(playlist_path) as f: | ||
for line in f: | ||
if line.startswith('#'): | ||
if line.startswith('#EXTINF'): | ||
matches = re.match(r'^#\w+:\d+(?:\s*\w+\=\".*\")*,(.*)$', line) | ||
if matches: | ||
title = matches[1] | ||
else: | ||
path = urllib.parse.unquote(line.rstrip()) | ||
if not os.path.isabs(path): | ||
path = os.path.join(playlist_dirname, path) | ||
movies.append(Movie(path, title)) | ||
title = None | ||
|
||
return Playlist(movies) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
from setuptools import setup, find_packages | ||
|
||
setup(name = 'Adafruit_Video_Looper', | ||
version = '1.0.4', | ||
version = '1.0.5', | ||
author = 'Tony DiCola', | ||
author_email = '[email protected]', | ||
description = 'Application to turn your Raspberry Pi into a dedicated looping video playback device, good for art installations, information displays, or just playing cat videos all day.', | ||
|