PageSourceSearch

https://hocmai.vn/theme/new2/js/player.js?v=3.4.26

js hocmai.vn collected 2026-09-24 09:16:20 UTC 4,566 bytes, 154 lines download raw bytes

1(function (window) {
2    var Player = function Player($type, $playerObject) {
3        this.type = $type;
4        this.object = $playerObject;
5    };
6
7    /**
8     * Get current of player time
9     * @returns {number}
10     */
11    Player.prototype.getTime = function() {
12        switch (this.type) {
13            case 'html5':
14                return this.object.currentTime();
15                break;
16            case 'flash':
17                return this.object.getTime();
18                break;
19            default:
20                return 0;
21                break;
22        }
23    };
24
25    Player.prototype.getClip = function() {
26        var $clip = null;
27        switch (this.type) {
28            case 'html5':
29                var $playlist = this.object.playlist(),
30                    $index = this.object.playlist.currentItem();
31                if ($index == -1) {
32                    $index = 0;//Fix chưa set clip
33                }
34                if (typeof $playlist[$index] == 'object') {
35                    $clip = $playlist[$index].clip;
36                }
37                break;
38            case 'flash':
39                $clip = this.object.getClip();
40                break;
41        }
42        return $clip;
43    };
44
45    Player.prototype.getClipIndex = function() {
46        var $index = 0;
47        switch (this.type) {
48            case 'html5':
49                $index = this.object.playlist.currentItem();
50                if ($index == -1) {
51                    $index = 0;
52                }
53                break;
54            case 'flash':
55                var $clip = this.object.getClip();
56                $index = $clip ? $clip.index : 0;
57                break;
58        }
59        return $index;
60    };
61
62    Player.prototype.getScoID = function() {
63        var $scoID = 0;
64        switch (this.type) {
65            case 'html5':
66                var $playlist = this.object.playlist(),
67                    $index = this.object.playlist.currentItem();
68
69                if (typeof $playlist[$index] == 'object') {
70                    var $clip = $playlist[$index].clip;
71                    $scoID = $clip.id;
72                }
73                break;
74            case 'flash':
75                var $clip = this.object.getClip();
76                $scoID = getUrlParam('scoid', $clip.originalUrl);
77                if($scoID == ''){
78                    $scoID = 0;
79                }
80                break;
81        }
82        if (!$scoID) {
83            $scoID = 0;
84        }
85        return $scoID;
86    };
87
88    Player.prototype.seek = function($offsetTime) {
89        switch (this.type) {
90            case 'html5':
91                this.object.currentTime($offsetTime);
92                break;
93            case 'flash':
94                this.object.seek($offsetTime);
95                break;
96        }
97    };
98
99    Player.prototype.play = function ($offsetTime) {
100        switch (this.type) {
101            case 'html5':
102                if (typeof $offsetTime == 'number') {
103                    this.object.currentTime($offsetTime);
104                }
105                this.object.play();
106                break;
107            case 'flash':
108                this.object.play($offsetTime);
109                break;
110        }
111    };
112
113    Player.prototype.pause = function () {
114        switch (this.type) {
115            case 'html5':
116                this.object.pause();
117                break;
118            case 'flash':
119                this.object.pause();
120                break;
121        }
122    };
123
124    Player.prototype.onStart = function ($callback) {
125        switch (this.type) {
126            case 'html5':
127                var self = this.object;
128                this.object.on('play', function () {
129                    var $playlist = self.playlist(),
130                        $index = self.playlist.currentItem(),
131                        $beforeEvent = $(self).data('beforeEvent');
132
133                    switch ($beforeEvent) {
134                        case 'pause':
135                            //Resume
136                            break;
137                        default:
138                            //Start
139                            if (typeof $playlist[$index] == 'object') {
140                                var $clip = $playlist[$index].clip;
141                                $callback.apply(self, $clip);
142                            }
143                            break;
144                    }
145                });
146                break;
147            case 'flash':
148                this.object.onStart($callback);
149                break;
150        }
151    };
152
153    window.Player = Player;
154})(window);

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.