rocketwheel-command 1.1.0 → 1.1.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.
@@ -1,5 +1,5 @@
1
1
  module Rocketwheel
2
2
  module Command
3
- VERSION = '1.1.0'
3
+ VERSION = '1.1.1'
4
4
  end
5
5
  end
@@ -21,12 +21,12 @@ player:
21
21
 
22
22
  meta:
23
23
  company: 'com'
24
- project: 'pro'
24
+ project: 'project'
25
25
  description: 'description'
26
26
  page-title: 'page title'
27
27
  share-title: 'share this title'
28
28
  share-url: 'http://www.'
29
- share-image: '/images/'
29
+ share-image: 'images/'
30
30
  share-description: 'share this description'
31
31
  share-sitename: 'share this sitename'
32
32
  share-pub-id: 'b9f8cca1-6dd1-42d9-b354-0ae0088e96cc'
@@ -23,7 +23,7 @@
23
23
  <meta name="viewport" content="width=880" />
24
24
  <script type="text/javascript">
25
25
  //tracking vars
26
- var track_category = 'Tracking - Cat';
26
+ var track_category = "<%= meta['tracking-category']%>";
27
27
  var percentage_played = 0;
28
28
  var secs_played = 0;
29
29
  var track_play = true;
@@ -1,18 +1,18 @@
1
1
  <!DOCTYPE HTML>
2
2
  <html>
3
3
  <head>
4
- <title>Title</title>
5
- <meta property="og:title" content="Title" />
4
+ <title><%= meta['page-title']%></title>
5
+ <meta property="og:title" content="<%= meta['share-title']%>" />
6
6
  <meta property="og:type" content="Sharing Widgets" />
7
- <meta property="og:url" content="http://www." />
8
- <meta property="og:image" content="" />
9
- <meta property="og:description" content="Description" />
10
- <meta property="og:site_name" content="" />
7
+ <meta property="og:url" content="<%= meta['share-url']%>" />
8
+ <meta property="og:image" content="<%= meta['share-image']%><%= meta['company']%>-<%= meta['project']%>-poster-thumb.jpg" />
9
+ <meta property="og:description" content="<%= meta['share-description']%>" />
10
+ <meta property="og:site_name" content="<%= meta['share-sitename']%>" />
11
11
  <link rel="stylesheet" href="demoplayer/stylesheets/player-1280x720.css" type="text/css" media="screen">
12
12
  <script src="demoplayer/javascripts/player.js" type="text/javascript"></script>
13
13
  <script type="text/javascript">
14
14
  var _gaq = _gaq || [];
15
- _gaq.push(['_setAccount', 'UA-xxxxxxx-x']);
15
+ _gaq.push(['_setAccount', '<%= meta["ga-tracking-id"]%>']);
16
16
  _gaq.push(['_trackPageview']);
17
17
  (function() {
18
18
  var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
@@ -20,13 +20,66 @@
20
20
  var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
21
21
  })();
22
22
  </script>
23
- <meta name="viewport" content="width=1290" />
23
+ <meta name="viewport" content="width=880" />
24
24
  <script type="text/javascript">
25
+ //tracking vars
26
+ var track_category = "<%= meta['tracking-category']%>";
27
+ var percentage_played = 0;
28
+ var secs_played = 0;
29
+ var track_play = true;
30
+ var title = null;
31
+ var this_duration = 0;
32
+ var video_completed = true;
33
+ var ctaLink = null;
34
+
25
35
  $(function() {
26
36
  Player.setup({
27
37
  playlist: <%= JSON.pretty_generate(playlist) %>,
28
38
  jwplayer_options: <%= JSON.pretty_generate(player_options) %>
29
39
  })
40
+ //Events and Tracking
41
+ Player.addHandler('onPlay', function() {
42
+ if(track_play) {
43
+ title = Player.Controller.playlist[Player.Controller.current.index].title;
44
+ this_duration = Player.Controller.playlist[Player.Controller.current.index].duration;
45
+ track_play = false;
46
+ video_completed = false;
47
+ _gaq.push(['_trackEvent', track_category, 'Video: Started', title]);
48
+ };
49
+ });
50
+ Player.addHandler('onComplete', function(e) {
51
+ video_completed = true;
52
+ track_play = true;
53
+ _gaq.push(['_trackEvent', track_category, 'Video: Completed', title]);
54
+ _gaq.push(['_trackEvent', track_category, 'Video: Seconds Played', title, this_duration]);
55
+ _gaq.push(['_trackEvent', track_category, 'Video: Percentage Played', title, 100]);
56
+ });
57
+ Player.addHandler('onPlaylistItem', function(e) {
58
+ if(!video_completed) {
59
+ _gaq.push(['_trackEvent', track_category, 'Video: Seconds Played', title, secs_played]);
60
+ _gaq.push(['_trackEvent', track_category, 'Video: Percentage Played', title, percentage_played]);
61
+ }
62
+ track_play = true;
63
+ });
64
+ Player.addHandler('onTime', function(e) {
65
+ secs_played = Math.round(e.position);
66
+ percentage_played = Math.round((secs_played / this_duration) * 100);
67
+ });
68
+ $('.track-link').live("click", function(event){
69
+ event.preventDefault();
70
+ _gaq.push(['_trackEvent', track_category, $(this).data('track-action') , Player.Controller.playlist[Player.Controller.current.index].title]);
71
+ ctaLink = $(this).attr('href');
72
+ setTimeout(function() {
73
+ top.location.href = ctaLink;
74
+ }, 1500);
75
+ });
76
+ window.onbeforeunload = function(e) {
77
+ if(!video_completed) {
78
+ _gaq.push(['_trackEvent', track_category, 'Video: Percentage Played', title, percentage_played]);
79
+ _gaq.push(['_trackEvent', track_category, 'Video: Seconds Played', title, secs_played]);
80
+ }
81
+ };
82
+ //end of Events and Tracking
30
83
  })
31
84
  </script>
32
85
  </head>
@@ -46,12 +99,20 @@
46
99
  </div>
47
100
  {{/view}}
48
101
  </script>
102
+ <script type="text/x-handlebars" data-template-name="annotations">
103
+ {{#annotation cta-1 video="1" start="59" image="images/<%= meta['company']%>-<%= meta['project']%>-cta-720.jpg"}}
104
+ <a class="track-link" href="http://www." data-track-action="CTA: Video - Contact Us" style="border: 1px solid red; position: absolute;top: 335px;left: 470px;width: 230px;height: 60px;"></a>
105
+ <div class="demoplayer-action-playfirst">
106
+ <a href="#" id="replay"><img src="demoplayer/images/replay.png" /></a>
107
+ </div>
108
+ {{/annotation}}
109
+ </script>
49
110
  </div>
50
111
  <script type="text/javascript">var switchTo5x=true;</script>
51
112
  <script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script>
52
113
  <script type="text/javascript">
53
114
  stLight.options({
54
- publisher:'b9f8cca1-6dd1-42d9-b354-0ae0088e96cc',
115
+ publisher:'<%= meta["share-pub-id"]%>',
55
116
  onhover:false
56
117
  });
57
118
  </script>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rocketwheel-command
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: