rocketwheel-command 1.0.9 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  module Rocketwheel
2
2
  module Command
3
- VERSION = '1.0.9'
3
+ VERSION = '1.1.0'
4
4
  end
5
5
  end
@@ -26,11 +26,12 @@ meta:
26
26
  page-title: 'page title'
27
27
  share-title: 'share this title'
28
28
  share-url: 'http://www.'
29
- share-image: 'http://www.'
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'
33
33
  ga-tracking-id: 'UA-xxxxxxx-x'
34
+ tracking-category: 'Company - Project'
34
35
 
35
36
  # transloadit:
36
37
  # key: transloadit key
@@ -5,7 +5,7 @@
5
5
  <meta property="og:title" content="<%= meta['share-title']%>" />
6
6
  <meta property="og:type" content="Sharing Widgets" />
7
7
  <meta property="og:url" content="<%= meta['share-url']%>" />
8
- <meta property="og:image" content="<%= meta['share-image']%>" />
8
+ <meta property="og:image" content="<%= meta['share-image']%><%= meta['company']%>-<%= meta['project']%>-poster-thumb.jpg" />
9
9
  <meta property="og:description" content="<%= meta['share-description']%>" />
10
10
  <meta property="og:site_name" content="<%= meta['share-sitename']%>" />
11
11
  <link rel="stylesheet" href="demoplayer/stylesheets/player.css" type="text/css" media="screen">
@@ -22,11 +22,64 @@
22
22
  </script>
23
23
  <meta name="viewport" content="width=880" />
24
24
  <script type="text/javascript">
25
+ //tracking vars
26
+ var track_category = 'Tracking - Cat';
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,6 +99,14 @@
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-480.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>
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.0.9
4
+ version: 1.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-07-19 00:00:00.000000000 Z
12
+ date: 2013-07-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: thor