Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuat committed May 6, 2017
0 parents commit 073d980
Show file tree
Hide file tree
Showing 36 changed files with 393 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.DS_Store
/releases
*.alfredworkflow
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Video Controls for Alfred
===

I'll update this later, but for now, available keywords:

- `airplay`
- `pip`
- `fullscreen`

Works with any video elements in Safari.
Binary file added alfred/018BBE1D-F229-4E9A-B10A-8C15F2091A17.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added alfred/6E4EEBD5-0AB8-4986-8EC0-1CD707F41689.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added alfred/9BD52D80-13AD-492C-9A4E-1FF2F4F501B3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added alfred/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
380 changes: 380 additions & 0 deletions alfred/info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,380 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>bundleid</key>
<string>co.joshuaturner.alfred.videocontrols</string>
<key>category</key>
<string>Productivity</string>
<key>connections</key>
<dict>
<key>018BBE1D-F229-4E9A-B10A-8C15F2091A17</key>
<array>
<dict>
<key>destinationuid</key>
<string>51A666A2-F74D-44F8-AD73-DFD9F3BAC718</string>
<key>modifiers</key>
<integer>0</integer>
<key>modifiersubtext</key>
<string></string>
<key>vitoclose</key>
<false/>
</dict>
</array>
<key>06850930-4C07-447E-AE10-08051871E1B6</key>
<array>
<dict>
<key>destinationuid</key>
<string>BD21A9FA-8D8E-414A-84E2-99BE6F3F1FE5</string>
<key>modifiers</key>
<integer>0</integer>
<key>modifiersubtext</key>
<string></string>
<key>vitoclose</key>
<false/>
</dict>
</array>
<key>51A666A2-F74D-44F8-AD73-DFD9F3BAC718</key>
<array>
<dict>
<key>destinationuid</key>
<string>BD21A9FA-8D8E-414A-84E2-99BE6F3F1FE5</string>
<key>modifiers</key>
<integer>0</integer>
<key>modifiersubtext</key>
<string></string>
<key>vitoclose</key>
<false/>
</dict>
</array>
<key>6E4EEBD5-0AB8-4986-8EC0-1CD707F41689</key>
<array>
<dict>
<key>destinationuid</key>
<string>E01A971C-4713-4542-A5E5-3B9279FC1B33</string>
<key>modifiers</key>
<integer>0</integer>
<key>modifiersubtext</key>
<string></string>
<key>vitoclose</key>
<false/>
</dict>
</array>
<key>9BD52D80-13AD-492C-9A4E-1FF2F4F501B3</key>
<array>
<dict>
<key>destinationuid</key>
<string>06850930-4C07-447E-AE10-08051871E1B6</string>
<key>modifiers</key>
<integer>0</integer>
<key>modifiersubtext</key>
<string></string>
<key>vitoclose</key>
<false/>
</dict>
</array>
<key>BD21A9FA-8D8E-414A-84E2-99BE6F3F1FE5</key>
<array>
<dict>
<key>destinationuid</key>
<string>F96CB837-4F11-4F31-98CF-211BF786FF05</string>
<key>modifiers</key>
<integer>0</integer>
<key>modifiersubtext</key>
<string></string>
<key>vitoclose</key>
<false/>
</dict>
</array>
<key>E01A971C-4713-4542-A5E5-3B9279FC1B33</key>
<array>
<dict>
<key>destinationuid</key>
<string>BD21A9FA-8D8E-414A-84E2-99BE6F3F1FE5</string>
<key>modifiers</key>
<integer>0</integer>
<key>modifiersubtext</key>
<string></string>
<key>vitoclose</key>
<false/>
</dict>
</array>
</dict>
<key>createdby</key>
<string>Joshua Turner</string>
<key>description</key>
<string>Enable Picture in Picture, Fullscreen, and Airplay on any HTML5 video in Safari</string>
<key>disabled</key>
<false/>
<key>name</key>
<string>Video Controls</string>
<key>objects</key>
<array>
<dict>
<key>config</key>
<dict>
<key>argumenttype</key>
<integer>2</integer>
<key>keyword</key>
<string>pip</string>
<key>subtext</key>
<string>Enter Picture in Picture in Safari if a video is playing in the foreground.</string>
<key>text</key>
<string>Enter Picture in Picture</string>
<key>withspace</key>
<false/>
</dict>
<key>type</key>
<string>alfred.workflow.input.keyword</string>
<key>uid</key>
<string>6E4EEBD5-0AB8-4986-8EC0-1CD707F41689</string>
<key>version</key>
<integer>1</integer>
</dict>
<dict>
<key>config</key>
<dict>
<key>argument</key>
<string></string>
<key>variables</key>
<dict>
<key>code</key>
<string>javascript:document.querySelector('video').webkitSetPresentationMode('picture-in-picture');</string>
<key>name</key>
<string>Picture in Picture</string>
<key>type</key>
<string>pip</string>
</dict>
</dict>
<key>type</key>
<string>alfred.workflow.utility.argument</string>
<key>uid</key>
<string>E01A971C-4713-4542-A5E5-3B9279FC1B33</string>
<key>version</key>
<integer>1</integer>
</dict>
<dict>
<key>config</key>
<dict>
<key>concurrently</key>
<false/>
<key>escaping</key>
<integer>0</integer>
<key>script</key>
<string>ObjC.import('stdlib')
var code = $.getenv('code')
var name = $.getenv('name')
var frontmostAppName = Application('System Events').applicationProcesses.where({ frontmost: true }).name()[0]
var frontmostApp = Application(frontmostAppName)
if (['Safari', 'Safari Technology Preview'].indexOf(frontmostAppName) &gt; -1) {
frontmostApp.includeStandardAdditions = true
try {
availableVideo = frontmostApp.doJavaScript("document.querySelectorAll('video').length;", { in: frontmostApp.documents[0] })
if (availableVideo) {
frontmostApp.doJavaScript(code, { in: frontmostApp.documents[0] })
stdout = undefined
} else {
stdout = "No HTML5 videos were found in the focused tab of Safari."
}
} catch(err) {
stdout = "You need to enable 'Allow JavaScript from Apple Events' in the Safari Develop menu. The Develop menu can be enabled in Safari's Preferences &gt; Advanced tab."
}
} else {
stdout = "Safari needs to be the focused app to trigger " + name + "."
}</string>
<key>scriptargtype</key>
<integer>1</integer>
<key>scriptfile</key>
<string></string>
<key>type</key>
<integer>7</integer>
</dict>
<key>type</key>
<string>alfred.workflow.action.script</string>
<key>uid</key>
<string>BD21A9FA-8D8E-414A-84E2-99BE6F3F1FE5</string>
<key>version</key>
<integer>2</integer>
</dict>
<dict>
<key>config</key>
<dict>
<key>argumenttype</key>
<integer>2</integer>
<key>keyword</key>
<string>fullscreen</string>
<key>subtext</key>
<string>Enter Fullscreen in Safari if a video is playing in the foreground.</string>
<key>text</key>
<string>Enter Fullscreen</string>
<key>withspace</key>
<false/>
</dict>
<key>type</key>
<string>alfred.workflow.input.keyword</string>
<key>uid</key>
<string>9BD52D80-13AD-492C-9A4E-1FF2F4F501B3</string>
<key>version</key>
<integer>1</integer>
</dict>
<dict>
<key>config</key>
<dict>
<key>lastpathcomponent</key>
<false/>
<key>onlyshowifquerypopulated</key>
<true/>
<key>removeextension</key>
<false/>
<key>text</key>
<string>{query}</string>
<key>title</key>
<string>{var:name}</string>
</dict>
<key>type</key>
<string>alfred.workflow.output.notification</string>
<key>uid</key>
<string>F96CB837-4F11-4F31-98CF-211BF786FF05</string>
<key>version</key>
<integer>1</integer>
</dict>
<dict>
<key>config</key>
<dict>
<key>argument</key>
<string></string>
<key>variables</key>
<dict>
<key>code</key>
<string>javascript:document.querySelector('video').webkitRequestFullscreen();</string>
<key>name</key>
<string>Fullscreen</string>
<key>type</key>
<string>fullscreen</string>
</dict>
</dict>
<key>type</key>
<string>alfred.workflow.utility.argument</string>
<key>uid</key>
<string>06850930-4C07-447E-AE10-08051871E1B6</string>
<key>version</key>
<integer>1</integer>
</dict>
<dict>
<key>config</key>
<dict>
<key>argumenttype</key>
<integer>1</integer>
<key>keyword</key>
<string>airplay</string>
<key>subtext</key>
<string>Show Airplay Menu in Safari if a video is playing in the foreground.</string>
<key>text</key>
<string>Show Airplay Menu</string>
<key>withspace</key>
<true/>
</dict>
<key>type</key>
<string>alfred.workflow.input.keyword</string>
<key>uid</key>
<string>018BBE1D-F229-4E9A-B10A-8C15F2091A17</string>
<key>version</key>
<integer>1</integer>
</dict>
<dict>
<key>config</key>
<dict>
<key>argument</key>
<string></string>
<key>variables</key>
<dict>
<key>code</key>
<string>javascript:document.querySelector('video').webkitShowPlaybackTargetPicker();</string>
<key>name</key>
<string>Airplay</string>
<key>type</key>
<string>airplay</string>
</dict>
</dict>
<key>type</key>
<string>alfred.workflow.utility.argument</string>
<key>uid</key>
<string>51A666A2-F74D-44F8-AD73-DFD9F3BAC718</string>
<key>version</key>
<integer>1</integer>
</dict>
</array>
<key>readme</key>
<string></string>
<key>uidata</key>
<dict>
<key>018BBE1D-F229-4E9A-B10A-8C15F2091A17</key>
<dict>
<key>xpos</key>
<integer>100</integer>
<key>ypos</key>
<integer>310</integer>
</dict>
<key>06850930-4C07-447E-AE10-08051871E1B6</key>
<dict>
<key>xpos</key>
<integer>290</integer>
<key>ypos</key>
<integer>230</integer>
</dict>
<key>51A666A2-F74D-44F8-AD73-DFD9F3BAC718</key>
<dict>
<key>xpos</key>
<integer>290</integer>
<key>ypos</key>
<integer>340</integer>
</dict>
<key>6E4EEBD5-0AB8-4986-8EC0-1CD707F41689</key>
<dict>
<key>xpos</key>
<integer>100</integer>
<key>ypos</key>
<integer>90</integer>
</dict>
<key>9BD52D80-13AD-492C-9A4E-1FF2F4F501B3</key>
<dict>
<key>xpos</key>
<integer>100</integer>
<key>ypos</key>
<integer>200</integer>
</dict>
<key>BD21A9FA-8D8E-414A-84E2-99BE6F3F1FE5</key>
<dict>
<key>xpos</key>
<integer>420</integer>
<key>ypos</key>
<integer>200</integer>
</dict>
<key>E01A971C-4713-4542-A5E5-3B9279FC1B33</key>
<dict>
<key>xpos</key>
<integer>290</integer>
<key>ypos</key>
<integer>120</integer>
</dict>
<key>F96CB837-4F11-4F31-98CF-211BF786FF05</key>
<dict>
<key>xpos</key>
<integer>610</integer>
<key>ypos</key>
<integer>200</integer>
</dict>
</dict>
<key>version</key>
<string></string>
<key>webaddress</key>
<string></string>
</dict>
</plist>
Binary file added icons/icns/airplay.icns
Binary file not shown.
Binary file added icons/icns/fullscreen.icns
Binary file not shown.
Binary file added icons/icns/pip.icns
Binary file not shown.
Binary file added icons/icns/video.icns
Binary file not shown.
Binary file added icons/png/airplay-1024.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/png/airplay-128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/png/airplay-256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/png/airplay-32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/png/airplay-512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/png/airplay-64.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/png/fullscreen-1024.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/png/fullscreen-128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/png/fullscreen-256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/png/fullscreen-32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/png/fullscreen-512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/png/fullscreen-64.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/png/pip-1024.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/png/pip-128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/png/pip-256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/png/pip-32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/png/pip-512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/png/pip-64.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/png/video-1024.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/png/video-128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/png/video-256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/png/video-32.png
Binary file added icons/png/video-512.png
Binary file added icons/png/video-64.png
Binary file added icons/sketch/html5.sketch
Binary file not shown.

0 comments on commit 073d980

Please sign in to comment.