-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dfb0923
commit 0220312
Showing
7 changed files
with
136 additions
and
104 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
$purple-color: rgba(255, 0, 0, 0.015); | ||
$red-color: #f0731e; |
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,78 @@ | ||
<script lang="ts"> | ||
import { fade } from 'svelte/transition'; | ||
import { trackClick } from '../google-analytics'; | ||
import videoExample from '../video-example'; | ||
import normalizeLink from './normalize-link'; | ||
import VideoSelectorBtn from './video-selector-btn.svelte'; | ||
import { LocalRoom } from '../local-room'; | ||
export let room: LocalRoom; | ||
export let playUrl: string | null; | ||
let blobUrl: string; | ||
let fileName: string; | ||
$: playUrl = $room?.isLocalMode ? blobUrl : normalizeLink($room?.url); | ||
const selectExample = function () { | ||
$room.url = videoExample(); | ||
trackClick('example'); | ||
}; | ||
const selectOnlineMode = function () { | ||
$room.isLocalMode = false; | ||
trackClick('select_online_mode'); | ||
}; | ||
const selectLocalMode = function () { | ||
$room.isLocalMode = true; | ||
trackClick('select_local_mode'); | ||
}; | ||
</script> | ||
|
||
<h3>1. Select a video</h3> | ||
<ul class="uk-subnav uk-subnav-pill" uk-switcher> | ||
<span>Select movie source:</span> | ||
<li class:uk-active={!$room.isLocalMode}> | ||
<a on:click={selectOnlineMode} class="uk-button-default">Online link</a> | ||
</li> | ||
<span>or</span> | ||
<li class:uk-active={$room.isLocalMode}> | ||
<a on:click={selectLocalMode} class="uk-button-default">File on computer</a> | ||
</li> | ||
</ul> | ||
{#if $room.isLocalMode} | ||
<div class="uk-margin-bottom"> | ||
You all downloaded a movie already!? Well done! Everyone should select the same video file, please. | ||
</div> | ||
<VideoSelectorBtn bind:videoUri={blobUrl} bind:fileName={fileName}/> | ||
{:else} | ||
<div class="uk-margin-bottom"> | ||
Insert a link to YouTube, Vimeo, HLS playlist, video or audio file. The input is synchronized with everyone in the room. | ||
</div> | ||
<div class="uk-inline uk-width-1-1"> | ||
{#if !playUrl} | ||
<a | ||
class="uk-form-icon uk-form-icon-flip uk-text-small uk-padding-small uk-width-auto pointer" | ||
on:click={selectExample} | ||
transition:fade | ||
> | ||
paste random example | ||
</a> | ||
{/if} | ||
<input | ||
bind:value={$room.url} | ||
class="uk-input" | ||
class:uk-form-danger={!playUrl} | ||
placeholder="Video URL" | ||
/> | ||
</div> | ||
{/if} | ||
|
||
<style lang="scss"> | ||
@import '../constants.scss'; | ||
.uk-subnav-pill > .uk-active > a { | ||
background-color: $red-color; | ||
} | ||
</style> |
File renamed without changes.
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,21 @@ | ||
<script lang="ts"> | ||
import { LocalRoom } from '../local-room'; | ||
import VideoView from './video-view.svelte'; | ||
export let room: LocalRoom; | ||
export let playUrl: string | null; | ||
</script> | ||
|
||
<h3>3. Watch the movie together!</h3> | ||
<div> | ||
Playback, time, and video scrolling are synchronized with everyone who has the page open. | ||
</div> | ||
<div class="uk-flex-1 uk-flex uk-flex-center uk-flex-column uk-flex-center uk-flex-middle"> | ||
{#if playUrl} | ||
<VideoView bind:paused={$room.paused} bind:time={$room.time} url={playUrl}/> | ||
{:else} | ||
<div class="uk-text-small uk-flex uk-flex-center uk-flex-column"> | ||
Video player will appear here when you insert a link or select a video | ||
</div> | ||
{/if} | ||
</div> |
File renamed without changes.
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