PageSourceSearch

https://www.car.org/scripts/video_page.js

js car.org collected 2026-10-02 02:39:46 UTC 9,884 bytes, 189 lines download raw bytes

1var _car_video = (function () {
2    var _videos = {},
3        method = {
4            init: function () {
5              
6                var myPlayer = videojs('main_player_vid');
7                var $firstVideoElement = $('.filterContent .filterGridRow .filterGridItem').filter(":first");
8
9                var videoID = $firstVideoElement.find("a.videoItem").data('id');
10                var videoDescText = $firstVideoElement.find("h6").text();
11
12                var videoIDt = $(".recentVids ol").find("li.vjs-playlist-item").data('id');
13                if (typeof videoIDt != "undefined") {
14                    myPlayer.catalog.getVideo(videoIDt, function (error, video) {
15                        //console.log(video)
16                        myPlayer.catalog.load(video);
17                        //myPlayer.play();
18                    })
19                }
20
21                $('.playCurrentVideo').click(function () {
22                    if (typeof videoIDt != "undefined") {
23                        myPlayer.catalog.getVideo(videoIDt, function (error, video) {
24                            //console.log(video)
25                            myPlayer.catalog.load(video);
26                            myPlayer.play();
27                        })
28                    }
29                });
30
31                if (typeof videoID != "undefined") {
32                    myPlayer.catalog.getVideo(videoID, function (error, video) {
33                        //console.log(video)
34                        myPlayer.catalog.load(video);
35                        myPlayer.play();
36                    })
37                }
38                videojs("main_player_vid").ready(function () {
39                    myPlayer = this;
40                });
41                $('#current-vid-desc p').text(videoDescText);
42
43                var section = 'videowall';
44                $('.filterCatgeoryWrapper .filterDropdown').find('li').each(function () {
45                    var _id = $(this).find('p').data('id');
46                    $(this).on('click', function () {
47                        method.send_query(_id, 1)
48                    });
49                });
50                $('.filterCatgeoryWrapper .dropdownExpand').unbind().on('change', function () {
51                    method.get_playlist($(this).find('option[value="' + $(this).val() + '"]').data('id'));
52                    _car_global.global.changeFilterForMobile($(this));
53                });
54                $(document).on("click", 'a.videoItem', function (e) {
55                    e.preventDefault();
56                    $('.videoPage .filterCatgeoryWrapper .loaderWrapper').addClass('active');
57                    $("input[name='videoItem']").val($(this).data('id'));
58                    $("input[name='startPosition']").val(0);
59                    $("input[name='pagination']").val($('.page-item.number.active').data('value'));
60
61                    var myPlayer = videojs('main_player_vid');
62                    myPlayer.catalog.getVideo($(this).data('id'), function (error, video) {
63                        //console.log(video)
64                        myPlayer.catalog.load(video);
65                        myPlayer.play();
66                    })
67                    var videoDesc = $(this).find("h6").text();
68                    $('#current-vid-desc p').text(videoDesc);
69
70                    setTimeout(function () {
71                        $('.videoPage .filterCatgeoryWrapper .loaderWrapper').removeClass('active');
72                        $('html, body').animate({
73                            scrollTop: $("#currentVideoAnchor").offset().top
74                        }, 100);
75                    }, 500)
76
77                    // $('form[name="playlistForm"]').submit();
78                });
79
80
81                $(document).on("click", 'li.vjs-playlist-item', function (e) {
82                    e.preventDefault();
83                    var myPlayer = videojs('main_player_vid');
84                    videoIDt = $(this).data('id');
85                    myPlayer.catalog.getVideo(videoIDt, function (error, video) {
86                        myPlayer.catalog.load(video);
87                        myPlayer.play();
88                    })
89                    var videoName = $(this).find(".vjs-playlist-name").text();
90                    $('.videoInfo .headline').text(videoName);
91                    var videoDesc = $(this).find(".vjs-playlist-description").text();
92                    $('.videoInfo .copy').text(videoDesc);
93                });
94
95                myPlayer.on('ended', function () {
96                    alert('video is done!');
97                });
98                $(document).on('click', ".page-item.number .page-link, .page-item.nextArrow .page-link, .page-item.prevArrow .page-link", function (e) {
99                    e.preventDefault();
100                    $('.page-item.number.active').removeClass('active');
101                    $(this).parent('li').addClass('active');
102                    var page = $(this).data('value');
103                    method.send_query($('.filterCatgeoryWrapper .dropdownExpand').find(':selected').data('id'), page)
104                })
105
106                //$('.pagination').find('.page-item.number').each(function () {
107                //    $(this).unbind();
108                //    $(this).on('click', function () {
109                //        $('.page-item.number.active').removeClass('active');
110                //        $(this).addClass('active');
111                //        (parseFloat($(this).data('value')) > 1) ? $('.page-item.prevArrow').removeClass('inactive') : $('.page-item.prevArrow').addClass('inactive');
112                //        (parseFloat($(this).data('value')) < parseFloat($('.pagination').data('total'))) ? $('.page-item.nextArrow').removeClass('inactive') : $('.page-item.nextArrow').addClass('inactive');
113                //        //method.send_query($('.filterCatgeoryWrapper .dropdownExpand').find(':selected').data('id'), $('.filterCatgeoryWrapper .dropdownExpand').find(':selected').html(), $(this).data('value'), section)
114                //    })
115                //})
116                //$('.pagination').find('.page-item.prevArrow').unbind()
117                //$('.pagination').find('.page-item.prevArrow').on('click', function () {
118                //    if (!$(this).hasClass('inactive')) {
119                //        //method.send_query($('.filterCatgeoryWrapper .dropdownExpand').find(':selected').data('id'), $('.filterCatgeoryWrapper .dropdownExpand').find(':selected').html(), (parseFloat($('.page-item.number.active').data('value')) - 1), section)
120                //    }
121                //});
122                //$('.pagination').find('.page-item.nextArrow').unbind()
123                //$('.pagination').find('.page-item.nextArrow').on('click', function () {
124                //    if (!$(this).hasClass('inactive')) {
125                //        //method.send_query($('.filterCatgeoryWrapper .dropdownExpand').find(':selected').data('id'), $('.filterCatgeoryWrapper .dropdownExpand').find(':selected').html(), (parseFloat($('.page-item.number.active').data('value')) + 1), section)
126                //    }
127                //})
128            },
129            send_query: function (categoryId, page) {
130                $('.loaderWrapper').addClass('active');
131                var currentItemID = $('#currentItemID').val();
132                var pagesToShow = $('#pagesToShow').val();
133                var resultOnPage = $('#resultOnPage').val();
134                $.ajax({
135                    url: '/api/sitecore/MediaConnector/GetVideos?DS=' + currentItemID,
136                    type: 'POST',
137                    data: { categoryId: categoryId, page: page, pagesToShow: pagesToShow, resultOnPage: resultOnPage },
138                    success: function (d) {
139                        //$('.filterCatgeoryWrapper').find('.catTitle h4').html(category);
140                        $('.filterContent').html(d);
141                        //method.init(section);
142                        setTimeout(function () {
143                            $('.loaderWrapper').removeClass('active');
144                        }, 1500)
145                    }
146                })
147            },
148            get_playlist: function (id, name) {
149
150                $("input[name='startPosition']").val(0);
151                $("input[name='playlistId']").val(id);
152                $("input[name='playlistName']").val(name);
153                $('form[name="playlistForm"]').submit();
154            },
155
156            start_carousel: function () {
157                $('.recentVids .vjs-playlist').find('.vjs-playlist-ad-overlay').remove();
158                var owl = $('.recentVids .vjs-playlist').show().owlCarousel({
159                    responsiveClass: true,
160                    responsive: {
161                        0: {
162                            margin: 10,
163                            loop: true,
164                            autoWidth: true,
165                            items: 3,
166                            dots: false
167                        },
168                        767: {
169                            margin: 10,
170                            loop: true,
171                            autoWidth: true,
172                            items: 4,
173                            dots: false
174                        }
175                    }
176                });
177                var _owl = $('.recentVids .vjs-playlist');
178                _owl.owlCarousel();
179                $('.scrollArrow-next').on('click', function () {
180                    _owl.trigger('next.owl.carousel');
181                });
182                $('.scrollArrow-prev').on('click', function () {
183                    _owl.trigger('prev.owl.carousel');
184                });
185            }
186        }
187
188    return method;
189})();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.