videojs-ng-socialshare 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/Gemfile +6 -0
- data/README.md +63 -0
- data/Rakefile +2 -0
- data/lib/videojs/ng/socialshare.rb +10 -0
- data/lib/videojs/ng/socialshare/version.rb +7 -0
- data/vendor/LICENSE +22 -0
- data/vendor/assets/javascripts/video-socialshare.js +265 -0
- data/vendor/assets/stylesheets/video-socialshare.css +115 -0
- data/videojs-ng-socialshare.gemspec +28 -0
- metadata +96 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: 95b19892aa09dfeba65957688db90879fc7cf7ea
|
|
4
|
+
data.tar.gz: 77b923e67789265f409d5f24078edcdfe122bda3
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 20ee7120117b466a859098173695565a6debd78fd48b41f5ec17691dc04f925530694d763a4fcb2bf1e477a62d07706db69035726fd7677c660b38f8bc9738f0
|
|
7
|
+
data.tar.gz: 87dbb13d6316e7456a858f62ce3327929cc15667700b44d0b318d4d48d03ae21a4f2621dbad56d9a15e9b0134965d01984594b3fb273d071a1e37849a23772b7
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/README.md
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# Videojs::Ng::Socialshare
|
|
2
|
+
|
|
3
|
+
Adds social sharing buttons to the video.js for Facebook and Twitter.
|
|
4
|
+
|
|
5
|
+
This gem bundles the upstream distribution for use with the Ruby on Rails framework. The version number of
|
|
6
|
+
the gem always tracks the upstream javascript release and the gem itself doesn't provide any additional
|
|
7
|
+
methods or helpers. If a need for helpers arises in the future they will be developed as a separate gem
|
|
8
|
+
with this one as its dependency. Should a gem bug be discovered an additional version identifier will be
|
|
9
|
+
appended and incremented after the upstream version number.
|
|
10
|
+
|
|
11
|
+
## License
|
|
12
|
+
videojs-ng-socialshare gem and changes made to the video.js socialShare plugin required for rails are licensed under ISC.
|
|
13
|
+
|
|
14
|
+
The original video.js socialshare plugin code distributed with this gem is licensed under [MIT](https://tldrlegal.com/license/mit-license)
|
|
15
|
+
You can find the plugins license file in the vendor directory, changes made to the original code base are as follows:
|
|
16
|
+
|
|
17
|
+
- none so far
|
|
18
|
+
|
|
19
|
+
Please note, the initial plugin code of socialShare lives under
|
|
20
|
+
|
|
21
|
+
- https://github.com/jmccraw/videojs-socialShare
|
|
22
|
+
|
|
23
|
+
this gem however packages:
|
|
24
|
+
|
|
25
|
+
- https://github.com/AdamTyler/videojs-socialShare
|
|
26
|
+
|
|
27
|
+
which is an updated and extended fork of the initial repository,
|
|
28
|
+
most significant change fixes the plugin for video.js 6+
|
|
29
|
+
|
|
30
|
+
licensing has been unchanged between that fork and the origin repository.
|
|
31
|
+
|
|
32
|
+
Since both repositories don't do releases of recent changes the commit ID used to bundle
|
|
33
|
+
the plugin from AdamTyle/videojs-socialShare repository is: 75fd0d55e9a801babc281d19b017229325bf5664
|
|
34
|
+
|
|
35
|
+
## Installation
|
|
36
|
+
|
|
37
|
+
Add this line to your application's Gemfile:
|
|
38
|
+
|
|
39
|
+
```ruby
|
|
40
|
+
gem 'videojs-ng-socialshare'
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
And then execute:
|
|
44
|
+
|
|
45
|
+
$ bundle
|
|
46
|
+
|
|
47
|
+
Or install it yourself as:
|
|
48
|
+
|
|
49
|
+
$ gem install videojs-ng-socialshare
|
|
50
|
+
|
|
51
|
+
## Usage
|
|
52
|
+
|
|
53
|
+
Include the plugin in your `application.js`:
|
|
54
|
+
|
|
55
|
+
//= video-socialshare
|
|
56
|
+
|
|
57
|
+
Include the stylesheet in `application.css':
|
|
58
|
+
|
|
59
|
+
*= video-socialshare
|
|
60
|
+
|
|
61
|
+
## Contributing
|
|
62
|
+
|
|
63
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/koparo/videojs-ng-socialshare.
|
data/Rakefile
ADDED
data/vendor/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2015 Justin McCraw
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Video.js Social Share
|
|
3
|
+
* Created by Justin McCraw for New York Media LLC
|
|
4
|
+
* License information: https://github.com/jmccraw/videojs-socialShare/blob/master/LICENSE
|
|
5
|
+
* Plugin details: https://github.com/jmccraw/videojs-socialShare
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
;(function(root, factory) {
|
|
10
|
+
if (typeof define === 'function' && define.amd) {
|
|
11
|
+
define('videojs-socialshare', ["video.js"], function (a0) {
|
|
12
|
+
return (factory(a0));
|
|
13
|
+
});
|
|
14
|
+
} else if (typeof exports === 'object') {
|
|
15
|
+
module.exports = factory(require("video.js"));
|
|
16
|
+
} else {
|
|
17
|
+
root['videojs-socialshare'] = factory(videojs);
|
|
18
|
+
}
|
|
19
|
+
}(this, function (videojs) {
|
|
20
|
+
|
|
21
|
+
(function(window, videojs, undefined) {
|
|
22
|
+
"use strict";
|
|
23
|
+
window['videojs_socialshare'] = { version: "1.0.1" };
|
|
24
|
+
|
|
25
|
+
var socialShare = function(opts) {
|
|
26
|
+
opts = opts || {};
|
|
27
|
+
var player = this;
|
|
28
|
+
var _ss;
|
|
29
|
+
var fbIcon = '<svg class="vjs-social-share-svg" xmlns="http://www.w3.org/2000/svg" role="presentation" width="36" height="36" viewBox="0 0 36 36" preserveAspectRatio="xMinYMin meet"><path fill-rule="evenodd" clip-rule="evenodd" fill="#3E5C9B" d="M5.4 0h25.2c3 0 5.4 2.4 5.4 5.4v25.2c0 3-2.4 5.4-5.4 5.4h-25.2c-3 0-5.4-2.4-5.4-5.4v-25.2c0-3 2.4-5.4 5.4-5.4z"></path><path fill="#fff" d="M19.4 28v-9.2h4l.6-3.3h-4.6v-2.4c0-1.1.3-1.8 2-1.8h2.6v-3.1c-.4 0-1.1-.2-2.6-.2-3.1 0-5.7 1.8-5.7 5v2.5h-3.7v3.3h3.7v9.2h3.7z"></path></svg>';
|
|
30
|
+
var twIcon = '<svg class="vjs-social-share-svg" xmlns="http://www.w3.org/2000/svg" role="presentation" width="36" height="36" viewBox="0 0 36 36" preserveAspectRatio="xMinYMin meet"><path fill-rule="evenodd" clip-rule="evenodd" fill="#28A9E1" d="M5.4 0h25.2c3 0 5.4 2.4 5.4 5.4v25.2c0 3-2.4 5.4-5.4 5.4h-25.2c-3 0-5.4-2.4-5.4-5.4v-25.2c0-3 2.4-5.4 5.4-5.4z"></path><path fill="#fff" d="M28.2 12.3c-.7.3-1.4.5-2.2.6.8-.5 1.4-1.2 1.7-2.1-.7.4-1.5.7-2.4.9-.7-.7-1.7-1.2-2.8-1.2-2.1 0-3.8 1.7-3.8 3.8 0 .3 0 .6.1.9-3.1-.2-5.9-1.7-7.8-3.9-.3.6-.5 1.2-.5 1.9 0 1.3.7 2.5 1.7 3.1-.6 0-1.2-.2-1.7-.5 0 1.8 1.3 3.3 3 3.7-.3.1-.6.1-1 .1-.2 0-.5 0-.7-.1.5 1.5 1.9 2.6 3.5 2.6-1.3 1-2.9 1.6-4.7 1.6-.3 0-.6 0-.9-.1 1.7 1.1 3.6 1.7 5.8 1.7 6.9 0 10.7-5.7 10.7-10.7v-.5c.8-.4 1.5-1 2-1.8z"></path></svg>';
|
|
31
|
+
var embedIcon = '<svg xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMinYMin meet" viewBox="0 0 36 36" height="36" width="36" role="presentation" class="vjs-social-share-svg"><path fill-rule="evenodd" clip-rule="evenodd" fill="#666" d="M5.4 0h25.2c3 0 5.4 2.4 5.4 5.4v25.2c0 3-2.4 5.4-5.4 5.4h-25.2c-3 0-5.4-2.4-5.4-5.4v-25.2c0-3 2.4-5.4 5.4-5.4z"></path><path fill="#fff" d="m 15.110455,24.59026 -1.59668,1.611328 -9.8437499,-8.217774 9.8437499,-8.2177732 1.59668,1.6259762 -7.9833986,6.5625 7.9833986,6.635743 z"></path><path fill="#fff" d="m 21.24815,11.392017 1.582031,-1.6259762 9.84375,8.2177732 -9.84375,8.217774 -1.582031,-1.611328 7.983399,-6.577149 -7.983399,-6.621094 z" ></path></svg>';
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Launches the Twitter Web Intent form in a new window
|
|
35
|
+
* @type {function}
|
|
36
|
+
*/
|
|
37
|
+
function launchTweet(e) {
|
|
38
|
+
e.preventDefault();
|
|
39
|
+
|
|
40
|
+
window.open(
|
|
41
|
+
'http://twitter.com/intent/tweet' +
|
|
42
|
+
'?text=' + encodeURIComponent(opts.twitter.shareText ? opts.twitter.shareText : '') +
|
|
43
|
+
'&url=' + encodeURIComponent(opts.twitter.shareUrl ? opts.twitter.shareUrl : window.location.href) +
|
|
44
|
+
'&via=' + (opts.twitter.handle ? opts.twitter.handle : ''),
|
|
45
|
+
'Share This Video to Twitter',
|
|
46
|
+
'width=600,height=300,left=' + Math.ceil((window.innerWidth / 2) - 300) + ',top=' +
|
|
47
|
+
Math.ceil((window.innerHeight / 2) - 127)
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Launches the Facebook modal
|
|
53
|
+
* @type {function}
|
|
54
|
+
*/
|
|
55
|
+
function launchFacebook(e) {
|
|
56
|
+
e.preventDefault();
|
|
57
|
+
var url = opts.facebook.shareUrl ? opts.facebook.shareUrl : window.location.href;
|
|
58
|
+
var fb_app_id = opts.facebook.app_id ? opts.facebook.app_id : '';
|
|
59
|
+
if (fb_app_id == '') {
|
|
60
|
+
if (!!document.querySelector('meta[property="fb:app_id"]')) {
|
|
61
|
+
fb_app_id = document.querySelector('meta[property="fb:app_id"]').content;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if (typeof FB !== 'undefined') {
|
|
66
|
+
// assumes you have the proper og metadata filled out for your site
|
|
67
|
+
FB.ui({
|
|
68
|
+
method: 'share',
|
|
69
|
+
href: url,
|
|
70
|
+
picture: opts.facebook.shareImage ? opts.facebook.shareImage : '',
|
|
71
|
+
name: '',
|
|
72
|
+
caption: '',
|
|
73
|
+
description: opts.facebook.shareText ? opts.facebook.shareText : ''
|
|
74
|
+
}, function (response) {
|
|
75
|
+
});
|
|
76
|
+
} else if (fb_app_id !== '') {
|
|
77
|
+
// since the FB object doesn't exist, try to scrape the page for og information and use a new window URL method
|
|
78
|
+
window.open(
|
|
79
|
+
'https://www.facebook.com/dialog/share' +
|
|
80
|
+
'?app_id=' + fb_app_id +
|
|
81
|
+
'&display=popup' +
|
|
82
|
+
'&href=' + encodeURIComponent(url) +
|
|
83
|
+
'&redirect_uri=' + encodeURIComponent(url),
|
|
84
|
+
'Share This Video to Facebook',
|
|
85
|
+
'width=600,height=300,left=' + Math.ceil((window.innerWidth / 2) - 300) + ',top=' +
|
|
86
|
+
Math.ceil((window.innerHeight / 2) - 127)
|
|
87
|
+
);
|
|
88
|
+
} else {
|
|
89
|
+
// Facebook isn't implemented properly in your site's metadata, so we'll just hide this element
|
|
90
|
+
// a little jarring, but better than failing, perhaps
|
|
91
|
+
this.style.display = 'none';
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
var _embed_window = null;
|
|
96
|
+
function launchEmbed(e) {
|
|
97
|
+
e.preventDefault();
|
|
98
|
+
|
|
99
|
+
if (_embed_window === null)
|
|
100
|
+
{
|
|
101
|
+
_embed_window = document.createElement('div');
|
|
102
|
+
_embed_window.className = 'embed-window';
|
|
103
|
+
_embed_window.innerHTML = '<input type="text" name="embed-code" class="embed-code" readonly="readonly"><br /><button id="btn-copy">Copy</button>';
|
|
104
|
+
|
|
105
|
+
var embed_close = document.createElement('div');
|
|
106
|
+
embed_close.className = "embed-window-close";
|
|
107
|
+
embed_close.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" height="24" width="24"><path fill="#fff" id="path9812" d="m 3.9425039,20.057495 c -4.45165455,-4.451654 -4.45165455,-11.6633357 0,-16.1149908 4.4516552,-4.45165472 11.6633371,-4.45165472 16.1149911,0 4.451656,4.4516551 4.451656,11.6633368 0,16.1149908 -4.451654,4.451656 -11.6633359,4.451656 -16.1149911,0 z M 18.054251,5.9457492 c -3.338741,-3.3387414 -8.7697602,-3.3387414 -12.1085023,0 -3.338741,3.338741 -3.338741,8.7697618 0,12.1085018 3.3387421,3.338741 8.7697613,3.338741 12.1085023,0 3.338741,-3.33874 3.338741,-8.7697608 0,-12.1085018 z M 8.9728744,17.030371 6.9696295,15.027126 9.996756,12 6.9696295,8.9728742 8.9728744,6.9696296 12.000001,9.9967548 15.027127,6.9696296 17.030371,8.9728742 14.003246,12 l 3.027125,3.027126 -2.003244,2.003245 -3.027126,-3.027126 z" /></svg>';
|
|
108
|
+
|
|
109
|
+
embed_close.onclick = launchEmbed;
|
|
110
|
+
_embed_window.insertBefore(embed_close, _embed_window.firstChild);
|
|
111
|
+
|
|
112
|
+
var embed_title = document.createElement('span');
|
|
113
|
+
embed_title.className = 'embed-window-title';
|
|
114
|
+
embed_title.innerHTML = 'Embed Video';
|
|
115
|
+
_embed_window.insertBefore(embed_title, _embed_window.firstChild);
|
|
116
|
+
|
|
117
|
+
player.el().appendChild(_embed_window);
|
|
118
|
+
|
|
119
|
+
var el_btn = _embed_window.getElementsByTagName('button')[0];
|
|
120
|
+
el_btn.addEventListener('click', function(event) {
|
|
121
|
+
var el_input = _embed_window.getElementsByTagName('input')[0];
|
|
122
|
+
el_input.focus ();
|
|
123
|
+
el_input.setSelectionRange (0, opts.embed.embedMarkup.length);
|
|
124
|
+
|
|
125
|
+
/*
|
|
126
|
+
var selectedText = ""
|
|
127
|
+
selectedText = el_input.value.substring(el_input.selectionStart, el_input.selectionEnd);
|
|
128
|
+
console.log ("selected from " + el_input.selectionStart + " to " + el_input.selectionEnd + ": " + selectedText);
|
|
129
|
+
*/
|
|
130
|
+
|
|
131
|
+
var result = false;
|
|
132
|
+
try {
|
|
133
|
+
result = document.queryCommandSupported('copy');
|
|
134
|
+
if (result)
|
|
135
|
+
{
|
|
136
|
+
console.log ("copy is supported");
|
|
137
|
+
}
|
|
138
|
+
else
|
|
139
|
+
{
|
|
140
|
+
console.log ("copy is not supported");
|
|
141
|
+
}
|
|
142
|
+
result = document.execCommand('copy');
|
|
143
|
+
}
|
|
144
|
+
catch (err) {
|
|
145
|
+
result = false;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
if (result)
|
|
149
|
+
{
|
|
150
|
+
console.log('copied embed code to clipboard.');
|
|
151
|
+
}
|
|
152
|
+
else
|
|
153
|
+
{
|
|
154
|
+
console.log('unable to copy embed code to clipboard.');
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
_embed_window.style.display = 'none';
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
if (_embed_window.style.display === 'block')
|
|
162
|
+
{
|
|
163
|
+
_embed_window.style.display = 'none';
|
|
164
|
+
}
|
|
165
|
+
else
|
|
166
|
+
{
|
|
167
|
+
var el_input = _embed_window.getElementsByTagName('input')[0];
|
|
168
|
+
el_input.value = opts.embed.embedMarkup;
|
|
169
|
+
el_input.setSelectionRange (0, opts.embed.embedMarkup.length);
|
|
170
|
+
|
|
171
|
+
_embed_window.getElementsByTagName('input')[0].value = opts.embed.embedMarkup;
|
|
172
|
+
_embed_window.style.display = 'block';
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Generate the DOM elements for the social share tool
|
|
178
|
+
* @type {function}
|
|
179
|
+
*/
|
|
180
|
+
function constructSocialShareContent() {
|
|
181
|
+
var _frag = document.createDocumentFragment();
|
|
182
|
+
var _aside = document.createElement('aside');
|
|
183
|
+
var _button;
|
|
184
|
+
|
|
185
|
+
var channel = '';
|
|
186
|
+
for (channel in opts)
|
|
187
|
+
{
|
|
188
|
+
switch (channel)
|
|
189
|
+
{
|
|
190
|
+
case 'twitter':
|
|
191
|
+
_button = document.createElement('a');
|
|
192
|
+
_button.className = 'vjs-social-share-link';
|
|
193
|
+
_button.setAttribute('data-network', 'twitter');
|
|
194
|
+
_button.innerHTML = twIcon;
|
|
195
|
+
_button.addEventListener('click', launchTweet, false);
|
|
196
|
+
_aside.appendChild(_button);
|
|
197
|
+
break;
|
|
198
|
+
|
|
199
|
+
case 'facebook':
|
|
200
|
+
_button = document.createElement('a');
|
|
201
|
+
_button.className = 'vjs-social-share-link';
|
|
202
|
+
_button.setAttribute('data-network', 'facebook');
|
|
203
|
+
_button.innerHTML = fbIcon;
|
|
204
|
+
_button.addEventListener('click', launchFacebook, false);
|
|
205
|
+
_aside.appendChild(_button);
|
|
206
|
+
break;
|
|
207
|
+
|
|
208
|
+
case 'embed':
|
|
209
|
+
_button = document.createElement('a');
|
|
210
|
+
_button.className = 'vjs-social-share-link';
|
|
211
|
+
_button.setAttribute('data-network', 'embed');
|
|
212
|
+
_button.innerHTML = embedIcon;
|
|
213
|
+
_button.addEventListener('click', launchEmbed, false);
|
|
214
|
+
_aside.appendChild(_button);
|
|
215
|
+
break;
|
|
216
|
+
|
|
217
|
+
default:
|
|
218
|
+
if ((typeof opts[channel].iconsvg !== 'undefined')
|
|
219
|
+
&& (typeof opts[channel].callback === 'function'))
|
|
220
|
+
{
|
|
221
|
+
var network = 'custom';
|
|
222
|
+
|
|
223
|
+
if (typeof opts[channel].network !== 'undefined')
|
|
224
|
+
{
|
|
225
|
+
network = opts[channel].network;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
_button = document.createElement('a');
|
|
229
|
+
_button.className = 'vjs-social-share-link';
|
|
230
|
+
_button.setAttribute('data-network', network);
|
|
231
|
+
_button.innerHTML = opts[channel].iconsvg;
|
|
232
|
+
_button.addEventListener('click', function (e) { opts[channel].callback (e); }, false);
|
|
233
|
+
_aside.appendChild(_button);
|
|
234
|
+
}
|
|
235
|
+
break;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
// remove previously created elements (e.g. the user calls the plugin multiple
|
|
240
|
+
// times as videos are changed out)
|
|
241
|
+
var el = player.el().querySelector(".vjs-social-share");
|
|
242
|
+
if (el)
|
|
243
|
+
{
|
|
244
|
+
el.remove ();
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
_aside.className = 'vjs-social-share';
|
|
248
|
+
_ss = _aside;
|
|
249
|
+
_frag.appendChild(_aside);
|
|
250
|
+
|
|
251
|
+
player.el().appendChild(_frag);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
player.ready(function() {
|
|
255
|
+
constructSocialShareContent();
|
|
256
|
+
});
|
|
257
|
+
|
|
258
|
+
};
|
|
259
|
+
|
|
260
|
+
var registerPlugin = videojs.registerPlugin || videojs.plugin;
|
|
261
|
+
registerPlugin('socialShare', socialShare);
|
|
262
|
+
|
|
263
|
+
})(window, videojs);
|
|
264
|
+
|
|
265
|
+
}));
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
.vjs-social-share {
|
|
2
|
+
height: 40px;
|
|
3
|
+
position: absolute;
|
|
4
|
+
right: 30px;
|
|
5
|
+
text-align: center;
|
|
6
|
+
top: 14px;
|
|
7
|
+
transition: visibility 0.3s ease 0s, opacity 0.3s ease 0s;
|
|
8
|
+
width: auto;
|
|
9
|
+
z-index: 999;
|
|
10
|
+
visibility: visible;
|
|
11
|
+
opacity: 1;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.vjs-user-inactive .vjs-social-share {
|
|
15
|
+
visibility: hidden;
|
|
16
|
+
opacity: 0;
|
|
17
|
+
}
|
|
18
|
+
.vjs-user-inactive.vjs-paused .vjs-social-share {
|
|
19
|
+
visibility: visible;
|
|
20
|
+
opacity: 1;
|
|
21
|
+
}
|
|
22
|
+
.vjs-ad-playing .vjs-social-share {
|
|
23
|
+
display: none;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.vjs-social-share-link {
|
|
27
|
+
border: none;
|
|
28
|
+
cursor: pointer;
|
|
29
|
+
display: inline;
|
|
30
|
+
height: 30px;
|
|
31
|
+
margin-right: 10px;
|
|
32
|
+
position: relative;
|
|
33
|
+
width: 30px;
|
|
34
|
+
}
|
|
35
|
+
.vjs-social-share-link:last-of-type {
|
|
36
|
+
margin-right: 0;
|
|
37
|
+
}
|
|
38
|
+
.vjs-social-share-svg {
|
|
39
|
+
height: 30px;
|
|
40
|
+
width: 30px;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.embed-window {
|
|
44
|
+
position: absolute;
|
|
45
|
+
top: 64px;
|
|
46
|
+
left: 10%;
|
|
47
|
+
width: 80%;
|
|
48
|
+
color: black;
|
|
49
|
+
background: rgba(43, 51, 63, 1);
|
|
50
|
+
padding: 10px;
|
|
51
|
+
border-radius: 8px;
|
|
52
|
+
transition: visibility 0.3s ease 0s, opacity 0.3s ease 0s;
|
|
53
|
+
visibility: visible;
|
|
54
|
+
opacity: 1;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.vjs-user-inactive .embed-window {
|
|
58
|
+
visibility: hidden;
|
|
59
|
+
opacity: 0;
|
|
60
|
+
}
|
|
61
|
+
.vjs-user-inactive.vjs-paused .embed-window {
|
|
62
|
+
visibility: visible;
|
|
63
|
+
opacity: 1;
|
|
64
|
+
}
|
|
65
|
+
.vjs-ad-playing .embed-window {
|
|
66
|
+
display: none;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
.embed-window .embed-window-title {
|
|
71
|
+
font-size: 20px;
|
|
72
|
+
color: #FFF;
|
|
73
|
+
margin-top: 6px;
|
|
74
|
+
margin-left: 1px;
|
|
75
|
+
display: inline-block;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.embed-window input {
|
|
79
|
+
width: 100%;
|
|
80
|
+
background: rgba(43, 51, 63, 0);
|
|
81
|
+
border: 1px solid gray;
|
|
82
|
+
margin-bottom: 0;
|
|
83
|
+
color: white;
|
|
84
|
+
font-size: 14px;
|
|
85
|
+
padding: 6px 10px;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.embed-window .embed-window-close {
|
|
89
|
+
display: inline-block;
|
|
90
|
+
float: right;
|
|
91
|
+
color: white;
|
|
92
|
+
font-size: 1.5em;
|
|
93
|
+
background: rgba(43, 51, 63, 0);
|
|
94
|
+
padding: 3px;
|
|
95
|
+
margin-bottom: 5px;
|
|
96
|
+
cursor: pointer;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.embed-window button#btn-copy {
|
|
100
|
+
background-color: #3B4554;
|
|
101
|
+
border: 1px solid #808080;
|
|
102
|
+
color: white;
|
|
103
|
+
float: right;
|
|
104
|
+
margin: 8px 0;
|
|
105
|
+
padding: 15px 32px;
|
|
106
|
+
text-align: center;
|
|
107
|
+
text-decoration: none;
|
|
108
|
+
display: inline-block;
|
|
109
|
+
font-size: 16px;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.embed-window button#btn-copy:active {
|
|
113
|
+
background-color: #808080;
|
|
114
|
+
color: #3B4554;
|
|
115
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
|
+
require "videojs/ng/socialshare/version"
|
|
5
|
+
|
|
6
|
+
Gem::Specification.new do |spec|
|
|
7
|
+
spec.name = "videojs-ng-socialshare"
|
|
8
|
+
spec.version = Videojs::Ng::Socialshare::VERSION
|
|
9
|
+
spec.authors = ["Adam Wolk"]
|
|
10
|
+
spec.email = ["adam.wolk@koparo.com"]
|
|
11
|
+
|
|
12
|
+
spec.summary = %q{video.js socialshare plugin javascript bundle}
|
|
13
|
+
spec.description = %q{Adds social sharing buttons to video.js for Facebook and Twitter.}
|
|
14
|
+
spec.homepage = "https://github.com/koparo/videojs-ng-socialshare"
|
|
15
|
+
spec.license = 'ISC'
|
|
16
|
+
|
|
17
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
|
18
|
+
f.match(%r{^(test|spec|features)/})
|
|
19
|
+
end
|
|
20
|
+
spec.bindir = "exe"
|
|
21
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
22
|
+
spec.require_paths = ["lib"]
|
|
23
|
+
|
|
24
|
+
spec.add_development_dependency "bundler", "~> 1.15"
|
|
25
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
|
26
|
+
|
|
27
|
+
spec.add_dependency "videojs-ng", "~> 6.2.7"
|
|
28
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: videojs-ng-socialshare
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 1.0.1
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Adam Wolk
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: exe
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2017-10-16 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: bundler
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - "~>"
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '1.15'
|
|
20
|
+
type: :development
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - "~>"
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: '1.15'
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: rake
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - "~>"
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '10.0'
|
|
34
|
+
type: :development
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - "~>"
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: '10.0'
|
|
41
|
+
- !ruby/object:Gem::Dependency
|
|
42
|
+
name: videojs-ng
|
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
|
44
|
+
requirements:
|
|
45
|
+
- - "~>"
|
|
46
|
+
- !ruby/object:Gem::Version
|
|
47
|
+
version: 6.2.7
|
|
48
|
+
type: :runtime
|
|
49
|
+
prerelease: false
|
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
+
requirements:
|
|
52
|
+
- - "~>"
|
|
53
|
+
- !ruby/object:Gem::Version
|
|
54
|
+
version: 6.2.7
|
|
55
|
+
description: Adds social sharing buttons to video.js for Facebook and Twitter.
|
|
56
|
+
email:
|
|
57
|
+
- adam.wolk@koparo.com
|
|
58
|
+
executables: []
|
|
59
|
+
extensions: []
|
|
60
|
+
extra_rdoc_files: []
|
|
61
|
+
files:
|
|
62
|
+
- ".gitignore"
|
|
63
|
+
- Gemfile
|
|
64
|
+
- README.md
|
|
65
|
+
- Rakefile
|
|
66
|
+
- lib/videojs/ng/socialshare.rb
|
|
67
|
+
- lib/videojs/ng/socialshare/version.rb
|
|
68
|
+
- vendor/LICENSE
|
|
69
|
+
- vendor/assets/javascripts/video-socialshare.js
|
|
70
|
+
- vendor/assets/stylesheets/video-socialshare.css
|
|
71
|
+
- videojs-ng-socialshare.gemspec
|
|
72
|
+
homepage: https://github.com/koparo/videojs-ng-socialshare
|
|
73
|
+
licenses:
|
|
74
|
+
- ISC
|
|
75
|
+
metadata: {}
|
|
76
|
+
post_install_message:
|
|
77
|
+
rdoc_options: []
|
|
78
|
+
require_paths:
|
|
79
|
+
- lib
|
|
80
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
81
|
+
requirements:
|
|
82
|
+
- - ">="
|
|
83
|
+
- !ruby/object:Gem::Version
|
|
84
|
+
version: '0'
|
|
85
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
86
|
+
requirements:
|
|
87
|
+
- - ">="
|
|
88
|
+
- !ruby/object:Gem::Version
|
|
89
|
+
version: '0'
|
|
90
|
+
requirements: []
|
|
91
|
+
rubyforge_project:
|
|
92
|
+
rubygems_version: 2.6.13
|
|
93
|
+
signing_key:
|
|
94
|
+
specification_version: 4
|
|
95
|
+
summary: video.js socialshare plugin javascript bundle
|
|
96
|
+
test_files: []
|