1/** 2 3 * Module Name: MP3 Preview Module 4 5 * 6 7 * Module URI: Please contact with [email protected] 8 9 * Description: A Product Preview Application for MP3 Stores 10 11 * Version: 2.4.1 12 13 * 14 15 * @author Caglar Guler <[email protected]> 16 17 * @copyright 2007-2016 MEG Venture 18 19 * @license Copyright 2012, Caglar Guler ([email protected]) 20 21 * This program is not a free software: you can't redistribute it and/or modify 22 23 * it. All rights reserved. 24 25 * 26 27 * This copyright notice and licence should be retained in all modules based on this framework. 28 29 * This does not affect your rights to assert copyright over your own original work. 30 31 * However, the license of the audio player used in this module is provided below. 32 33 * This license is also in force. 34 35 * 36 37 * --------------------------------------------------------------------------------- 38 39 * License of the JPlayer used in this module 40 41 * 42 43 * jPlayer is the completely free and open source (MIT) media library written in JavaScript. 44 45 * For more information, please refer to jplayer.org 46 47 * --------------------------------------------------------------------------------- 48 49 * 50 51 * The mp3 upload system is adapted from the tutorial of Martin Angelov, May 2013 52 53 * Reference website --> http://tutorialzine.com/2013/05/mini-ajax-file-upload-form/ 54 55 */ 56 57 58 59(function(b, f) 60 61{ 62 63 "function" === typeof define && define.amd ? define(["jquery"], f) : 64 65 b.jQuery ? f(b.jQuery) : f(b.Zepto) 66 67})(this, function(b, f) 68 69{ 70 71 b.fn.jPlayer = function(a) 72 73 { 74 75 var c = "string" === typeof a, 76 77 d = Array.prototype.slice.call(arguments, 1), 78 79 e = this; 80 81 a = !c && d.length ? b.extend.apply(null, [!0, a].concat(d)) : a; 82 83 if (c && "_" === a.charAt(0)) return e; 84 85 c ? this.each(function() 86 87 { 88 89 var c = b(this).data("jPlayer"), 90 91 h = c && b.isFunction(c[a]) ? c[a].apply(c, d) : c; 92 93 if (h !== c && h !== f) return e = h, !1 94 95 }) : this.each(function() 96 97 { 98 99 var c = b(this).data("jPlayer"); 100 101 c ? c.option(a || 102 103 {}) : b(this).data("jPlayer", new b.jPlayer(a, this)) 104 105 }); 106 107 return e 108 109 }; 110 111 b.jPlayer = function(a, c) 112 113 { 114 115 if (arguments.length) 116 117 { 118 119 this.element = b(c); 120 121 this.options = b.extend(!0, 122 123 {}, this.options, a); 124 125 var d = this; 126 127 this.element.bind("remove.jPlayer", function() 128 129 { 130 131 d.destroy() 132 133 }); 134 135 this._init() 136 137 } 138 139 }; 140 141 "function" !== typeof b.fn.stop && (b.fn.stop = function() {}); 142 143 b.jPlayer.emulateMethods = "load play pause"; 144 145 b.jPlayer.emulateStatus = 146 147 "src readyState networkState currentTime duration paused ended playbackRate"; 148 149 b.jPlayer.emulateOptions = "muted volume"; 150 151 b.jPlayer.reservedEvent = 152 153 "ready flashreset resize repeat error warning"; 154 155 b.jPlayer.event = {}; 156 157 b.each( 158 159 "ready setmedia flashreset resize repeat click error warning loadstart progress suspend abort emptied stalled play pause loadedmetadata loadeddata waiting playing canplay canplaythrough seeking seeked timeupdate ended ratechange durationchange volumechange" 160 161 .split(" "), 162 163 function() 164 165 { 166 167 b.jPlayer.event[this] = "jPlayer_" + this 168 169 }); 170 171 b.jPlayer.htmlEvent = 172 173 "loadstart abort emptied stalled loadedmetadata loadeddata canplay canplaythrough" 174 175 .split(" "); 176 177 b.jPlayer.pause = function() 178 179 { 180 181 b.each(b.jPlayer.prototype.instances, function(a, c) 182 183 { 184 185 c.data("jPlayer").status.srcSet && c.jPlayer("pause") 186 187 }) 188 189 }; 190 191 b.jPlayer.timeFormat = { 192 193 showHour: !1, 194 195 showMin: !0, 196 197 showSec: !0, 198 199 padHour: !1, 200 201 padMin: !0, 202 203 padSec: !0, 204 205 sepHour: ":", 206 207 sepMin: ":", 208 209 sepSec: "" 210 211 }; 212 213 var l = function() 214 215 { 216 217 this.init() 218 219 }; 220 221 l.prototype = { 222 223 init: function() 224 225 { 226 227 this.options = { 228 229 timeFormat: b.jPlayer.timeFormat 230 231 } 232 233 }, 234 235 time: function(a) 236 237 { 238 239 var c = new Date(1E3 * (a && "number" === typeof a ? a : 0)), 240 241 b = c.getUTCHours(); 242 243 a = this.options.timeFormat.showHour ? c.getUTCMinutes() : c.getUTCMinutes() + 244 245 60 * b; 246 247 c = this.options.timeFormat.showMin ? c.getUTCSeconds() : c.getUTCSeconds() + 248 249 60 * a; 250 251 b = this.options.timeFormat.padHour && 10 > b ? "0" + b : b; 252 253 a = this.options.timeFormat.padMin && 10 > a ? "0" + a : a; 254 255 c = this.options.timeFormat.padSec && 10 > c ? "0" + c : c; 256 257 b = "" + (this.options.timeFormat.showHour ? b + this.options.timeFormat 258 259 .sepHour : ""); 260 261 b += this.options.timeFormat.showMin ? a + this.options.timeFormat 262 263 .sepMin : ""; 264 265 return b += this.options.timeFormat.showSec ? c + this.options.timeFormat 266 267 .sepSec : "" 268 269 } 270 271 }; 272 273 var n = new l; 274 275 b.jPlayer.convertTime = function(a) 276 277 { 278 279 return n.time(a) 280 281 }; 282 283 b.jPlayer.uaBrowser = function(a) 284 285 { 286 287 a = a.toLowerCase(); 288 289 var c = /(opera)(?:.*version)?[ \/]([\w.]+)/, 290 291 b = /(msie) ([\w.]+)/, 292 293 e = /(mozilla)(?:.*? rv:([\w.]+))?/; 294 295 a = /(webkit)[ \/]([\w.]+)/.exec(a) || c.exec(a) || b.exec(a) || 296 297 0 > a.indexOf("compatible") && e.exec(a) || []; 298 299 return { 300 301 browser: a[1] || "", 302 303 version: a[2] || "0" 304 305 } 306 307 }; 308 309 b.jPlayer.uaPlatform = function(a) 310 311 { 312 313 var c = a.toLowerCase(), 314 315 b = /(android)/, 316 317 e = /(mobile)/; 318 319 a = 320 321 /(ipad|iphone|ipod|android|blackberry|playbook|windows ce|webos)/ 322 323 .exec(c) || []; 324 325 c = /(ipad|playbook)/.exec(c) || !e.exec(c) && b.exec(c) || []; 326 327 a[1] && (a[1] = a[1].replace(/\s/g, "_"));
328 329 return { 330 331 platform: a[1] || "", 332 333 tablet: c[1] || "" 334 335 } 336 337 }; 338 339 b.jPlayer.browser = {}; 340 341 b.jPlayer.platform = {}; 342 343 var k = b.jPlayer.uaBrowser(navigator.userAgent); 344 345 k.browser && (b.jPlayer.browser[k.browser] = !0, b.jPlayer.browser.version = 346 347 k.version); 348 349 k = b.jPlayer.uaPlatform(navigator.userAgent); 350 351 k.platform && (b.jPlayer.platform[k.platform] = !0, b.jPlayer.platform 352 353 .mobile = !k.tablet, b.jPlayer.platform.tablet = !!k.tablet); 354 355 b.jPlayer.getDocMode = function() 356 357 { 358 359 var a; 360 361 b.jPlayer.browser.msie && (document.documentMode ? a = document.documentMode : 362 363 (a = 5, document.compatMode && "CSS1Compat" === document.compatMode && 364 365 (a = 7))); 366 367 return a 368 369 }; 370 371 b.jPlayer.browser.documentMode = b.jPlayer.getDocMode(); 372 373 b.jPlayer.nativeFeatures = { 374 375 init: function() 376 377 { 378 379 var a = document, 380 381 c = a.createElement("video"), 382 383 b = { 384 385 w3c: "fullscreenEnabled fullscreenElement requestFullscreen exitFullscreen fullscreenchange fullscreenerror" 386 387 .split(" "), 388 389 moz: "mozFullScreenEnabled mozFullScreenElement mozRequestFullScreen mozCancelFullScreen mozfullscreenchange mozfullscreenerror" 390 391 .split(" "), 392 393 webkit: " webkitCurrentFullScreenElement webkitRequestFullScreen webkitCancelFullScreen webkitfullscreenchange " 394 395 .split(" "), 396 397 webkitVideo: "webkitSupportsFullscreen webkitDisplayingFullscreen webkitEnterFullscreen webkitExitFullscreen " 398 399 .split(" ") 400 401 }, 402 403 e = ["w3c", "moz", "webkit", "webkitVideo"], 404 405 g, h; 406 407 this.fullscreen = c = { 408 409 support: 410 411 { 412 413 w3c: !!a[b.w3c[0]], 414 415 moz: !!a[b.moz[0]], 416 417 webkit: "function" === typeof a[b.webkit[3]], 418 419 webkitVideo: "function" === typeof c[b.webkitVideo[2]] 420 421 }, 422 423 used: 424 425 {} 426 427 }; 428 429 g = 0; 430 431 for (h = e.length; g < h; g++) 432 433 { 434 435 var f = e[g]; 436 437 if (c.support[f]) 438 439 { 440 441 c.spec = f; 442 443 c.used[f] = !0; 444 445 break 446 447 } 448 449 } 450 451 if (c.spec) 452 453 { 454 455 var m = b[c.spec]; 456 457 c.api = { 458 459 fullscreenEnabled: !0, 460 461 fullscreenElement: function(c) 462 463 { 464 465 c = c ? c : a; 466 467 return c[m[1]] 468 469 }, 470 471 requestFullscreen: function(a) 472 473 { 474 475 return a[m[2]]() 476 477 }, 478 479 exitFullscreen: function(c) 480 481 { 482 483 c = c ? c : a; 484 485 return c[m[3]]() 486 487 } 488 489 }; 490 491 c.event = { 492 493 fullscreenchange: m[4], 494 495 fullscreenerror: m[5] 496 497 } 498 499 } 500 501 else c.api = { 502 503 fullscreenEnabled: !1, 504 505 fullscreenElement: function() 506 507 { 508 509 return null 510 511 }, 512 513 requestFullscreen: function() {}, 514 515 exitFullscreen: function() {} 516 517 }, c.event = {} 518 519 } 520 521 }; 522 523 b.jPlayer.nativeFeatures.init(); 524 525 b.jPlayer.focus = null; 526 527 b.jPlayer.keyIgnoreElementNames = "INPUT TEXTAREA"; 528 529 var p = function(a) 530 531 { 532 533 var c = b.jPlayer.focus, 534 535 d; 536 537 c && (b.each(b.jPlayer.keyIgnoreElementNames.split(/\s+/g), 538 539 function(c, b) 540 541 { 542 543 if (a.target.nodeName.toUpperCase() === b.toUpperCase()) 544 545 return d = !0, !1 546 547 }), d || b.each(c.options.keyBindings, function(d, g) 548 549 { 550 551 if (g && a.which === g.key && b.isFunction(g.fn)) return a.preventDefault(), 552 553 g.fn(c), !1 554 555 })) 556 557 }; 558 559 b.jPlayer.keys = function(a) 560 561 { 562 563 b(document.documentElement).unbind("keydown.jPlayer"); 564 565 a && b(document.documentElement).bind("keydown.jPlayer", p) 566 567 }; 568 569 b.jPlayer.keys(!0); 570 571 b.jPlayer.prototype = { 572 573 count: 0, 574 575 version: 576 577 { 578 579 script: "2.6.0", 580 581 needFlash: "2.6.0", 582 583 flash: "unknown" 584 585 }, 586 587 options: 588 589 { 590 591 swfPath: "js", 592 593 solution: "html, flash", 594 595 supplied: "mp3", 596 597 preload: "metadata", 598 599 volume: 0.8, 600 601 muted: !1, 602 603 remainingDuration: !1, 604 605 toggleDuration: !1, 606 607 playbackRate: 1, 608 609 defaultPlaybackRate: 1, 610 611 minPlaybackRate: 0.5, 612 613 maxPlaybackRate: 4, 614 615 wmode: "opaque", 616 617 backgroundColor: "#000000", 618 619 cssSelectorAncestor: "#jp_container_1", 620 621 cssSelector: 622 623 { 624 625 videoPlay: ".jp-video-play", 626 627 play: ".jp-play", 628 629 pause: ".jp-pause", 630 631 stop: ".jp-stop", 632 633 seekBar: ".jp-seek-bar", 634 635 playBar: ".jp-play-bar", 636 637 mute: ".jp-mute", 638 639 unmute: ".jp-unmute",
vendor: 5,116 bytes, lines 640-1135
640 641 volumeBar: ".jp-volume-bar", 642 643 volumeBarValue: ".jp-volume-bar-value", 644 645 volumeMax: ".jp-volume-max", 646 647 playbackRateBar: ".jp-playback-rate-bar", 648 649 playbackRateBarValue: ".jp-playback-rate-bar-value", 650 651 currentTime: ".jp-current-time", 652 653 duration: ".jp-duration", 654 655 title: ".jp-title", 656 657 fullScreen: ".jp-full-screen", 658 659 restoreScreen: ".jp-restore-screen", 660 661 repeat: ".jp-repeat", 662 663 repeatOff: ".jp-repeat-off", 664 665 gui: ".jp-gui", 666 667 noSolution: ".jp-no-solution" 668 669 }, 670 671 smoothPlayBar: !1, 672 673 fullScreen: !1, 674 675 fullWindow: !1, 676 677 autohide: 678 679 { 680 681 restored: !1, 682 683 full: !0, 684 685 fadeIn: 200, 686 687 fadeOut: 600, 688 689 hold: 1E3 690 691 }, 692 693 loop: !1, 694 695 repeat: function(a) 696 697 { 698 699 a.jPlayer.options.loop ? b(this).unbind(".jPlayerRepeat").bind( 700 701 b.jPlayer.event.ended + ".jPlayer.jPlayerRepeat", 702 703 function() 704 705 { 706 707 b(this).jPlayer("play") 708 709 }) : b(this).unbind(".jPlayerRepeat") 710 711 }, 712 713 nativeVideoControls: 714 715 {}, 716 717 noFullWindow: 718 719 { 720 721 msie: /msie [0-6]\./, 722 723 ipad: /ipad.*?os [0-4]\./, 724 725 iphone: /iphone/, 726 727 ipod: /ipod/, 728 729 android_pad: /android [0-3]\.(?!.*?mobile)/, 730 731 android_phone: /android.*?mobile/, 732 733 blackberry: /blackberry/, 734 735 windows_ce: /windows ce/, 736 737 iemobile: /iemobile/, 738 739 webos: /webos/ 740 741 }, 742 743 noVolume: 744 745 { 746 747 ipad: /ipad/, 748 749 iphone: /iphone/, 750 751 ipod: /ipod/, 752 753 android_pad: /android(?!.*?mobile)/, 754 755 android_phone: /android.*?mobile/, 756 757 blackberry: /blackberry/, 758 759 windows_ce: /windows ce/, 760 761 iemobile: /iemobile/, 762 763 webos: /webos/, 764 765 playbook: /playbook/ 766 767 }, 768 769 timeFormat: 770 771 {}, 772 773 keyEnabled: !1, 774 775 audioFullScreen: !1, 776 777 keyBindings: 778 779 { 780 781 play: 782 783 { 784 785 key: 32, 786 787 fn: function(a) 788 789 { 790 791 a.status.paused ? a.play() : a.pause() 792 793 } 794 795 }, 796 797 fullScreen: 798 799 { 800 801 key: 13, 802 803 fn: function(a) 804 805 { 806 807 (a.status.video || a.options.audioFullScreen) && a._setOption( 808 809 "fullScreen", !a.options.fullScreen) 810 811 } 812 813 }, 814 815 muted: 816 817 { 818 819 key: 8, 820 821 fn: function(a) 822 823 { 824 825 a._muted(!a.options.muted) 826 827 } 828 829 }, 830 831 volumeUp: 832 833 { 834 835 key: 38, 836 837 fn: function(a) 838 839 { 840 841 a.volume(a.options.volume + 0.1) 842 843 } 844 845 }, 846 847 volumeDown: 848 849 { 850 851 key: 40, 852 853 fn: function(a) 854 855 { 856 857 a.volume(a.options.volume - 0.1) 858 859 } 860 861 } 862 863 }, 864 865 verticalVolume: !1, 866 867 verticalPlaybackRate: !1, 868 869 globalVolume: !1, 870 871 idPrefix: "jp", 872 873 noConflict: "jQuery", 874 875 emulateHtml: !1, 876 877 consoleAlerts: !0, 878 879 errorAlerts: !1, 880 881 warningAlerts: !1 882 883 }, 884 885 optionsAudio: 886 887 { 888 889 size: 890 891 { 892 893 width: "0px", 894 895 height: "0px", 896 897 cssClass: "" 898 899 }, 900 901 sizeFull: 902 903 { 904 905 width: "0px", 906 907 height: "0px", 908 909 cssClass: "" 910 911 } 912 913 }, 914 915 optionsVideo: 916 917 { 918 919 size: 920 921 { 922 923 width: "480px", 924 925 height: "270px", 926 927 cssClass: "jp-video-270p" 928 929 }, 930 931 sizeFull: 932 933 { 934 935 width: "100%", 936 937 height: "100%", 938 939 cssClass: "jp-video-full" 940 941 } 942 943 }, 944 945 instances: 946 947 {}, 948 949 status: 950 951 { 952 953 src: "", 954 955 media: 956 957 {}, 958 959 paused: !0, 960 961 format: 962 963 {}, 964 965 formatType: "", 966 967 waitForPlay: !0, 968 969 waitForLoad: !0, 970 971 srcSet: !1, 972 973 video: !1, 974 975 seekPercent: 0, 976 977 currentPercentRelative: 0, 978 979 currentPercentAbsolute: 0, 980 981 currentTime: 0, 982 983 duration: 0, 984 985 remaining: 0, 986 987 videoWidth: 0, 988 989 videoHeight: 0, 990 991 readyState: 0, 992 993 networkState: 0, 994 995 playbackRate: 1, 996 997 ended: 0 998 999 }, 1000 1001 internal: 1002 1003 { 1004 1005 ready: !1 1006 1007 }, 1008 1009 solution: 1010 1011 { 1012 1013 html: !0, 1014 1015 flash: !0 1016 1017 }, 1018 1019 format: 1020 1021 { 1022 1023 mp3: 1024 1025 { 1026 1027 codec: 'audio/mpeg; codecs="mp3"', 1028 1029 flashCanPlay: !0, 1030 1031 media: "audio" 1032 1033 }, 1034 1035 m4a: 1036 1037 { 1038 1039 codec: 'audio/mp4; codecs="mp4a.40.2"', 1040 1041 flashCanPlay: !0, 1042 1043 media: "audio" 1044 1045 }, 1046 1047 m3u8a: 1048 1049 { 1050 1051 codec: 'application/vnd.apple.mpegurl; codecs="mp4a.40.2"', 1052 1053 flashCanPlay: !1, 1054 1055 media: "audio" 1056 1057 }, 1058 1059 m3ua: 1060 1061 { 1062 1063 codec: "audio/mpegurl", 1064 1065 flashCanPlay: !1, 1066 1067 media: "audio" 1068 1069 }, 1070 1071 oga: 1072 1073 { 1074 1075 codec: 'audio/ogg; codecs="vorbis, opus"', 1076 1077 flashCanPlay: !1, 1078 1079 media: "audio" 1080 1081 }, 1082 1083 flac: 1084 1085 { 1086 1087 codec: "audio/x-flac", 1088 1089 flashCanPlay: !1, 1090 1091 media: "audio" 1092 1093 }, 1094 1095 wav: 1096 1097 { 1098 1099 codec: 'audio/wav; codecs="1"', 1100 1101 flashCanPlay: !1, 1102 1103 media: "audio" 1104 1105 }, 1106 1107 webma: 1108 1109 { 1110 1111 codec: 'audio/webm; codecs="vorbis"', 1112 1113 flashCanPlay: !1, 1114 1115 media: "audio" 1116 1117 }, 1118 1119 fla: 1120 1121 { 1122 1123 codec: "audio/x-flv", 1124 1125 flashCanPlay: !0, 1126 1127 media: "audio" 1128 1129 }, 1130 1131 rtmpa: 1132 1133 { 1134 1135 codec: 'audio/rtmp; codecs="rtmp"',
1136 1137 flashCanPlay: !0, 1138 1139 media: "audio" 1140 1141 }, 1142 1143 m4v: 1144 1145 { 1146 1147 codec: 'video/mp4; codecs="avc1.42E01E, mp4a.40.2"', 1148 1149 flashCanPlay: !0, 1150 1151 media: "video" 1152 1153 }, 1154 1155 m3u8v: 1156 1157 { 1158 1159 codec: 'application/vnd.apple.mpegurl; codecs="avc1.42E01E, mp4a.40.2"', 1160 1161 flashCanPlay: !1, 1162 1163 media: "video" 1164 1165 }, 1166 1167 m3uv: 1168 1169 { 1170 1171 codec: "audio/mpegurl", 1172 1173 flashCanPlay: !1, 1174 1175 media: "video" 1176 1177 }, 1178 1179 ogv: 1180 1181 { 1182 1183 codec: 'video/ogg; codecs="theora, vorbis"', 1184 1185 flashCanPlay: !1, 1186 1187 media: "video" 1188 1189 }, 1190 1191 webmv: 1192 1193 { 1194 1195 codec: 'video/webm; codecs="vorbis, vp8"', 1196 1197 flashCanPlay: !1, 1198 1199 media: "video" 1200 1201 }, 1202 1203 flv: 1204 1205 { 1206 1207 codec: "video/x-flv", 1208 1209 flashCanPlay: !0, 1210 1211 media: "video" 1212 1213 }, 1214 1215 rtmpv: 1216 1217 { 1218 1219 codec: 'video/rtmp; codecs="rtmp"', 1220 1221 flashCanPlay: !0, 1222 1223 media: "video" 1224 1225 } 1226 1227 }, 1228 1229 _init: function() 1230 1231 { 1232 1233 var a = this; 1234 1235 this.element.empty(); 1236 1237 this.status = b.extend( 1238 1239 {}, this.status); 1240 1241 this.internal = b.extend( 1242 1243 {}, this.internal); 1244 1245 this.options.timeFormat = b.extend( 1246 1247 {}, b.jPlayer.timeFormat, this.options.timeFormat); 1248 1249 this.internal.cmdsIgnored = b.jPlayer.platform.ipad || b.jPlayer 1250 1251 .platform.iphone || b.jPlayer.platform.ipod; 1252 1253 this.internal.domNode = this.element.get(0); 1254 1255 this.options.keyEnabled && !b.jPlayer.focus && (b.jPlayer.focus = 1256 1257 this); 1258 1259 this.androidFix = { 1260 1261 setMedia: !1, 1262 1263 play: !1, 1264 1265 pause: !1, 1266 1267 time: NaN 1268 1269 }; 1270 1271 b.jPlayer.platform.android && (this.options.preload = "auto" !== 1272 1273 this.options.preload ? "metadata" : "auto"); 1274 1275 this.formats = []; 1276 1277 this.solutions = []; 1278 1279 this.require = {}; 1280 1281 this.htmlElement = {}; 1282 1283 this.html = {}; 1284 1285 this.html.audio = {}; 1286 1287 this.html.video = {}; 1288 1289 this.flash = {}; 1290 1291 this.css = {}; 1292 1293 this.css.cs = {}; 1294 1295 this.css.jq = {}; 1296 1297 this.ancestorJq = []; 1298 1299 this.options.volume = this._limitValue(this.options.volume, 0, 1300 1301 1); 1302 1303 b.each(this.options.supplied.toLowerCase().split(","), function( 1304 1305 c, d) 1306 1307 { 1308 1309 var e = d.replace(/^\s+|\s+$/g, ""); 1310 1311 if (a.format[e]) 1312 1313 { 1314 1315 var f = !1; 1316 1317 b.each(a.formats, function(a, c) 1318 1319 { 1320 1321 if (e === c) return f = !0, !1 1322 1323 }); 1324 1325 f || a.formats.push(e) 1326 1327 } 1328 1329 }); 1330 1331 b.each(this.options.solution.toLowerCase().split(","), function( 1332 1333 c, d) 1334 1335 { 1336 1337 var e = d.replace(/^\s+|\s+$/g, ""); 1338 1339 if (a.solution[e]) 1340 1341 { 1342 1343 var f = !1; 1344 1345 b.each(a.solutions, function(a, c) 1346 1347 { 1348 1349 if (e === c) return f = !0, !1 1350 1351 }); 1352 1353 f || a.solutions.push(e) 1354 1355 } 1356 1357 }); 1358 1359 this.internal.instance = "jp_" + this.count; 1360 1361 this.instances[this.internal.instance] = this.element; 1362 1363 this.element.attr("id") || this.element.attr("id", this.options 1364 1365 .idPrefix + "_jplayer_" + this.count); 1366 1367 this.internal.self = b.extend( 1368 1369 {}, 1370 1371 { 1372 1373 id: this.element.attr("id"), 1374 1375 jq: this.element 1376 1377 }); 1378 1379 this.internal.audio = b.extend( 1380 1381 {}, 1382 1383 { 1384 1385 id: this.options.idPrefix + "_audio_" + this.count, 1386 1387 jq: f 1388 1389 }); 1390 1391 this.internal.video = b.extend( 1392 1393 {}, 1394 1395 { 1396 1397 id: this.options.idPrefix + "_video_" + this.count, 1398 1399 jq: f 1400 1401 }); 1402 1403 this.internal.flash = b.extend( 1404 1405 {}, 1406 1407 { 1408 1409 id: this.options.idPrefix + "_flash_" + this.count, 1410 1411 jq: f, 1412 1413 swf: this.options.swfPath + (".swf" !== this.options.swfPath 1414 1415 .toLowerCase().slice(-4) ? (this.options.swfPath && "/" !== 1416 1417 this.options.swfPath.slice(-1) ? "/" : "") + 1418 1419 "Jplayer.swf" : "") 1420 1421 }); 1422 1423 this.internal.poster = b.extend( 1424 1425 {}, 1426 1427 { 1428 1429 id: this.options.idPrefix + "_poster_" + this.count, 1430 1431 jq: f 1432 1433 }); 1434 1435 b.each(b.jPlayer.event, function(c, b) 1436 1437 { 1438 1439 a.options[c] !== f && (a.element.bind(b + ".jPlayer", a.options[ 1440 1441 c]), a.options[c] = f) 1442 1443 }); 1444 1445 this.require.audio = !1; 1446 1447 this.require.video = !1; 1448 1449 b.each(this.formats, function(c, b) 1450 1451 { 1452 1453 a.require[a.format[b].media] = !0 1454 1455 }); 1456 1457 this.options = this.require.video ? b.extend(!0, 1458 1459 {}, this.optionsVideo, this.options) : b.extend(!0, 1460 1461 {}, this.optionsAudio, this.options); 1462 1463 this._setSize(); 1464 1465 this.status.nativeVideoControls = this._uaBlocklist(this.options 1466 1467 .nativeVideoControls); 1468 1469 this.status.noFullWindow = this._uaBlocklist(this.options.noFullWindow); 1470 1471 this.status.noVolume = this._uaBlocklist(this.options.noVolume); 1472 1473 b.jPlayer.nativeFeatures.fullscreen.api.fullscreenEnabled && 1474 1475 this._fullscreenAddEventListeners(); 1476 1477 this._restrictNativeVideoControls(); 1478 1479 this.htmlElement.poster = document.createElement("img"); 1480 1481 this.htmlElement.poster.id = this.internal.poster.id; 1482 1483 this.htmlElement.poster.onload = function() 1484 1485 { 1486 1487 a.status.video && !a.status.waitForPlay || a.internal.poster.jq 1488 1489 .show() 1490 1491 }; 1492 1493 this.element.append(this.htmlElement.poster); 1494 1495 this.internal.poster.jq = b("#" + this.internal.poster.id); 1496 1497 this.internal.poster.jq.css( 1498 1499 { 1500 1501 width: this.status.width, 1502 1503 height: this.status.height 1504 1505 }); 1506 1507 this.internal.poster.jq.hide(); 1508 1509 this.internal.poster.jq.bind("click.jPlayer", function() 1510 1511 { 1512 1513 a._trigger(b.jPlayer.event.click) 1514 1515 }); 1516 1517 this.html.audio.available = !1; 1518 1519 this.require.audio && (this.htmlElement.audio = document.createElement( 1520 1521 "audio"), this.htmlElement.audio.id = this.internal.audio.id, 1522 1523 this.html.audio.available = !!this.htmlElement.audio.canPlayType && 1524 1525 this._testCanPlayType(this.htmlElement.audio)); 1526 1527 this.html.video.available = !1; 1528 1529 this.require.video && (this.htmlElement.video = document.createElement( 1530 1531 "video"), this.htmlElement.video.id = this.internal.video.id, 1532 1533 this.html.video.available = !!this.htmlElement.video.canPlayType && 1534 1535 this._testCanPlayType(this.htmlElement.video)); 1536 1537 this.flash.available = this._checkForFlash(10.1); 1538 1539 this.html.canPlay = {}; 1540 1541 this.flash.canPlay = {}; 1542 1543 b.each(this.formats, function(c, b) 1544 1545 { 1546 1547 a.html.canPlay[b] = a.html[a.format[b].media].available && 1548 1549 "" !== a.htmlElement[a.format[b].media].canPlayType(a.format[ 1550 1551 b].codec); 1552 1553 a.flash.canPlay[b] = a.format[b].flashCanPlay && a.flash.available 1554 1555 }); 1556 1557 this.html.desired = !1; 1558 1559 this.flash.desired = !1; 1560 1561 b.each(this.solutions, function(c, d) 1562 1563 { 1564 1565 if (0 === c) a[d].desired = !0; 1566 1567 else 1568 1569 { 1570 1571 var e = !1, 1572 1573 f = !1; 1574 1575 b.each(a.formats, function(c, b) 1576 1577 { 1578 1579 a[a.solutions[0]].canPlay[b] && ("video" === a.format[b] 1580 1581 .media ? f = !0 : e = !0) 1582 1583 });
1584 1585 a[d].desired = a.require.audio && !e || a.require.video && 1586 1587 !f 1588 1589 } 1590 1591 }); 1592 1593 this.html.support = {}; 1594 1595 this.flash.support = {}; 1596 1597 b.each(this.formats, function(c, b) 1598 1599 { 1600 1601 a.html.support[b] = a.html.canPlay[b] && a.html.desired; 1602 1603 a.flash.support[b] = a.flash.canPlay[b] && a.flash.desired 1604 1605 }); 1606 1607 this.html.used = !1; 1608 1609 this.flash.used = !1; 1610 1611 b.each(this.solutions, function(c, d) 1612 1613 { 1614 1615 b.each(a.formats, function(c, b) 1616 1617 { 1618 1619 if (a[d].support[b]) return a[d].used = !0, !1 1620 1621 }) 1622 1623 }); 1624 1625 this._resetActive(); 1626 1627 this._resetGate(); 1628 1629 this._cssSelectorAncestor(this.options.cssSelectorAncestor); 1630 1631 this.html.used || this.flash.used ? this.css.jq.noSolution.length && 1632 1633 this.css.jq.noSolution.hide() : (this._error( 1634 1635 { 1636 1637 type: b.jPlayer.error.NO_SOLUTION, 1638 1639 context: "{solution:'" + this.options.solution + 1640 1641 "', supplied:'" + this.options.supplied + "'}", 1642 1643 message: b.jPlayer.errorMsg.NO_SOLUTION, 1644 1645 hint: b.jPlayer.errorHint.NO_SOLUTION 1646 1647 }), this.css.jq.noSolution.length && this.css.jq.noSolution.show()); 1648 1649 if (this.flash.used) 1650 1651 { 1652 1653 var c, d = "jQuery=" + encodeURI(this.options.noConflict) + 1654 1655 "&id=" + encodeURI(this.internal.self.id) + "&vol=" + this.options 1656 1657 .volume + "&muted=" + this.options.muted; 1658 1659 if (b.jPlayer.browser.msie && (9 > Number(b.jPlayer.browser.version) || 1660 1661 9 > b.jPlayer.browser.documentMode)) 1662 1663 { 1664 1665 d = ['<param name="movie" value="' + this.internal.flash.swf + 1666 1667 '" />', '<param name="FlashVars" value="' + d + '" />', 1668 1669 '<param name="allowScriptAccess" value="always" />', 1670 1671 '<param name="bgcolor" value="' + this.options.backgroundColor + 1672 1673 '" />', '<param name="wmode" value="' + this.options.wmode + 1674 1675 '" />' 1676 1677 ]; 1678 1679 c = document.createElement('<object id="' + this.internal.flash 1680 1681 .id + 1682 1683 '" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="0" height="0" tabindex="-1"></object>' 1684 1685 ); 1686 1687 for (var e = 0; e < d.length; e++) c.appendChild(document.createElement( 1688 1689 d[e])) 1690 1691 } 1692 1693 else e = function(a, c, b) 1694 1695 { 1696 1697 var d = document.createElement("param"); 1698 1699 d.setAttribute("name", c); 1700 1701 d.setAttribute("value", b); 1702 1703 a.appendChild(d) 1704 1705 }, c = document.createElement("object"), 1706 1707 c.setAttribute("id", this.internal.flash.id), c.setAttribute( 1708 1709 "name", this.internal.flash.id), c.setAttribute("data", this 1710 1711 .internal.flash.swf), c.setAttribute("type", 1712 1713 "application/x-shockwave-flash"), c.setAttribute("width", 1714 1715 "1"), c.setAttribute("height", "1"), c.setAttribute( 1716 1717 "tabindex", "-1"), e(c, "flashvars", d), e(c, 1718 1719 "allowscriptaccess", "always"), e(c, "bgcolor", this.options 1720 1721 .backgroundColor), e(c, "wmode", this.options.wmode); 1722 1723 this.element.append(c); 1724 1725 this.internal.flash.jq = b(c) 1726 1727 } 1728 1729 this.status.playbackRateEnabled = this.html.used && !this.flash 1730 1731 .used ? this._testPlaybackRate("audio") : !1; 1732 1733 this._updatePlaybackRate(); 1734 1735 this.html.used && (this.html.audio.available && (this._addHtmlEventListeners( 1736 1737 this.htmlElement.audio, this.html.audio), this.element.append( 1738 1739 this.htmlElement.audio), this.internal.audio.jq = b("#" + 1740 1741 this.internal.audio.id)), this.html.video.available && (this 1742 1743 ._addHtmlEventListeners(this.htmlElement.video, this.html.video), 1744 1745 this.element.append(this.htmlElement.video), this.internal.video 1746 1747 .jq = b("#" + this.internal.video.id), this.status.nativeVideoControls ? 1748 1749 this.internal.video.jq.css( 1750 1751 { 1752 1753 width: this.status.width, 1754 1755 height: this.status.height 1756 1757 }) : this.internal.video.jq.css( 1758 1759 { 1760 1761 width: "0px", 1762 1763 height: "0px" 1764 1765 }), this.internal.video.jq.bind("click.jPlayer", function() 1766 1767 { 1768 1769 a._trigger(b.jPlayer.event.click) 1770 1771 }))); 1772 1773 this.options.emulateHtml && this._emulateHtmlBridge(); 1774 1775 this.html.used && !this.flash.used && setTimeout(function() 1776 1777 { 1778 1779 a.internal.ready = !0; 1780 1781 a.version.flash = "n/a"; 1782 1783 a._trigger(b.jPlayer.event.repeat); 1784 1785 a._trigger(b.jPlayer.event.ready) 1786 1787 }, 100); 1788 1789 this._updateNativeVideoControls(); 1790 1791 this.css.jq.videoPlay.length && this.css.jq.videoPlay.hide(); 1792 1793 b.jPlayer.prototype.count++ 1794 1795 }, 1796 1797 destroy: function() 1798 1799 { 1800 1801 this.clearMedia();
1802 1803 this._removeUiClass(); 1804 1805 this.css.jq.currentTime.length && this.css.jq.currentTime.text( 1806 1807 ""); 1808 1809 this.css.jq.duration.length && this.css.jq.duration.text(""); 1810 1811 b.each(this.css.jq, function(a, c) 1812 1813 { 1814 1815 c.length && c.unbind(".jPlayer") 1816 1817 }); 1818 1819 this.internal.poster.jq.unbind(".jPlayer"); 1820 1821 this.internal.video.jq && this.internal.video.jq.unbind( 1822 1823 ".jPlayer"); 1824 1825 this._fullscreenRemoveEventListeners(); 1826 1827 this === b.jPlayer.focus && (b.jPlayer.focus = null); 1828 1829 this.options.emulateHtml && this._destroyHtmlBridge(); 1830 1831 this.element.removeData("jPlayer"); 1832 1833 this.element.unbind(".jPlayer"); 1834 1835 this.element.empty(); 1836 1837 delete this.instances[this.internal.instance] 1838 1839 }, 1840 1841 enable: function() {}, 1842 1843 disable: function() {}, 1844 1845 _testCanPlayType: function(a) 1846 1847 { 1848 1849 try 1850 1851 { 1852 1853 return a.canPlayType(this.format.mp3.codec), !0 1854 1855 } 1856 1857 catch (c) 1858 1859 { 1860 1861 return !1 1862 1863 } 1864 1865 }, 1866 1867 _testPlaybackRate: function(a) 1868 1869 { 1870 1871 a = document.createElement("string" === typeof a ? a : "audio"); 1872 1873 try 1874 1875 { 1876 1877 return "playbackRate" in a ? (a.playbackRate = 0.5, 0.5 === a.playbackRate) : 1878 1879 !1 1880 1881 } 1882 1883 catch (c) 1884 1885 { 1886 1887 return !1 1888 1889 } 1890 1891 }, 1892 1893 _uaBlocklist: function(a) 1894 1895 { 1896 1897 var c = navigator.userAgent.toLowerCase(), 1898 1899 d = !1; 1900 1901 b.each(a, function(a, b) 1902 1903 { 1904 1905 if (b && b.test(c)) return d = !0, !1 1906 1907 }); 1908 1909 return d 1910 1911 }, 1912 1913 _restrictNativeVideoControls: function() 1914 1915 { 1916 1917 this.require.audio && this.status.nativeVideoControls && (this.status 1918 1919 .nativeVideoControls = !1, this.status.noFullWindow = !0) 1920 1921 }, 1922 1923 _updateNativeVideoControls: function() 1924 1925 { 1926 1927 this.html.video.available && this.html.used && (this.htmlElement 1928 1929 .video.controls = this.status.nativeVideoControls, this._updateAutohide(), 1930 1931 this.status.nativeVideoControls && this.require.video ? (this 1932 1933 .internal.poster.jq.hide(), this.internal.video.jq.css( 1934 1935 { 1936 1937 width: this.status.width, 1938 1939 height: this.status.height 1940 1941 })) : this.status.waitForPlay && this.status.video && (this.internal 1942 1943 .poster.jq.show(), this.internal.video.jq.css( 1944 1945 { 1946 1947 width: "0px", 1948 1949 height: "0px" 1950 1951 }))) 1952 1953 }, 1954 1955 _addHtmlEventListeners: function(a, c) 1956 1957 { 1958 1959 var d = this; 1960 1961 a.preload = this.options.preload; 1962 1963 a.muted = this.options.muted; 1964 1965 a.volume = this.options.volume; 1966 1967 this.status.playbackRateEnabled && (a.defaultPlaybackRate = 1968 1969 this.options.defaultPlaybackRate, a.playbackRate = this.options 1970 1971 .playbackRate); 1972 1973 a.addEventListener("progress", function() 1974 1975 { 1976 1977 c.gate && (d.internal.cmdsIgnored && 0 < this.readyState && 1978 1979 (d.internal.cmdsIgnored = !1), d.androidFix.setMedia = !1, 1980 1981 d.androidFix.play && (d.androidFix.play = !1, d.play(d.androidFix 1982 1983 .time)), d.androidFix.pause && (d.androidFix.pause = !1, 1984 1985 d.pause(d.androidFix.time)), d._getHtmlStatus(a), d._updateInterface(), 1986 1987 d._trigger(b.jPlayer.event.progress)) 1988 1989 }, !1); 1990 1991 a.addEventListener("timeupdate", function() 1992 1993 { 1994 1995 c.gate && (d._getHtmlStatus(a), d._updateInterface(), d._trigger( 1996 1997 b.jPlayer.event.timeupdate)) 1998 1999 }, !1); 2000 2001 a.addEventListener("durationchange", function() 2002 2003 { 2004 2005 c.gate && (d._getHtmlStatus(a), d._updateInterface(), d._trigger( 2006 2007 b.jPlayer.event.durationchange)) 2008 2009 }, !1); 2010 2011 a.addEventListener("play", function() 2012 2013 { 2014 2015 c.gate && (d._updateButtons(!0), d._html_checkWaitForPlay(), 2016 2017 d._trigger(b.jPlayer.event.play)) 2018 2019 }, !1); 2020 2021 a.addEventListener("playing", function() 2022 2023 { 2024 2025 c.gate && (d._updateButtons(!0), d._seeked(), d._trigger(b.jPlayer 2026 2027 .event.playing)) 2028 2029 }, !1); 2030 2031 a.addEventListener("pause", function() 2032 2033 { 2034 2035 c.gate && (d._updateButtons(!1), d._trigger(b.jPlayer.event.pause)) 2036 2037 }, !1); 2038 2039 a.addEventListener("waiting", function() 2040 2041 { 2042 2043 c.gate && (d._seeking(), d._trigger(b.jPlayer.event.waiting)) 2044 2045 }, !1); 2046 2047 a.addEventListener("seeking", function() 2048 2049 { 2050 2051 c.gate && (d._seeking(), d._trigger(b.jPlayer.event.seeking)) 2052 2053 }, !1); 2054 2055 a.addEventListener("seeked", function() 2056 2057 { 2058 2059 c.gate && (d._seeked(), d._trigger(b.jPlayer.event.seeked)) 2060 2061 }, !1); 2062 2063 a.addEventListener("volumechange", function() 2064 2065 { 2066 2067 c.gate && (d.options.volume = a.volume, d.options.muted = a.muted, 2068 2069 d._updateMute(), d._updateVolume(), d._trigger(b.jPlayer.event 2070 2071 .volumechange)) 2072 2073 }, !1); 2074 2075 a.addEventListener("ratechange", function() 2076 2077 { 2078 2079 c.gate && (d.options.defaultPlaybackRate = a.defaultPlaybackRate, 2080 2081 d.options.playbackRate = a.playbackRate, d._updatePlaybackRate(), 2082 2083 d._trigger(b.jPlayer.event.ratechange)) 2084 2085 }, !1); 2086 2087 a.addEventListener("suspend", function() 2088 2089 { 2090 2091 c.gate && (d._seeked(), d._trigger(b.jPlayer.event.suspend)) 2092 2093 }, !1); 2094 2095 a.addEventListener("ended", function() 2096 2097 { 2098 2099 c.gate && (b.jPlayer.browser.webkit || (d.htmlElement.media.currentTime = 2100 2101 0), d.htmlElement.media.pause(), d._updateButtons(!1), d._getHtmlStatus( 2102 2103 a, !0), d._updateInterface(), d._trigger(b.jPlayer.event.ended)) 2104 2105 }, !1); 2106 2107 a.addEventListener("error", function() 2108 2109 { 2110 2111 c.gate && (d._updateButtons(!1), d._seeked(), d.status.srcSet && 2112 2113 (clearTimeout(d.internal.htmlDlyCmdId), d.status.waitForLoad = ! 2114 2115 0, d.status.waitForPlay = !0, d.status.video && !d.status 2116 2117 .nativeVideoControls && d.internal.video.jq.css( 2118 2119 { 2120 2121 width: "0px", 2122 2123 height: "0px" 2124 2125 }), d._validString(d.status.media.poster) && !d.status.nativeVideoControls && 2126 2127 d.internal.poster.jq.show(), d.css.jq.videoPlay.length && 2128 2129 d.css.jq.videoPlay.show(), d._error( 2130 2131 { 2132 2133 type: b.jPlayer.error.URL, 2134 2135 context: d.status.src, 2136 2137 message: b.jPlayer.errorMsg.URL, 2138 2139 hint: b.jPlayer.errorHint.URL 2140 2141 }))) 2142 2143 }, !1); 2144 2145 b.each(b.jPlayer.htmlEvent, function(e, g) 2146 2147 { 2148 2149 a.addEventListener(this, function() 2150 2151 { 2152 2153 c.gate && d._trigger(b.jPlayer.event[g]) 2154 2155 }, !1) 2156 2157 }) 2158 2159 }, 2160 2161 _getHtmlStatus: function(a, c) 2162 2163 { 2164 2165 var b = 0, 2166 2167 e = 0, 2168 2169 g = 0, 2170 2171 f = 0; 2172 2173 isFinite(a.duration) && (this.status.duration = a.duration); 2174 2175 b = a.currentTime; 2176 2177 e = 0 < this.status.duration ? 100 * b / this.status.duration : 2178 2179 0; 2180 2181 "object" === typeof a.seekable && 0 < a.seekable.length ? (g = 2182 2183 0 < this.status.duration ? 100 * a.seekable.end(a.seekable.length - 2184 2185 1) / this.status.duration : 100, f = 0 < this.status.duration ? 2186 2187 100 * a.currentTime / a.seekable.end(a.seekable.length - 1) : 2188 2189 0) : (g = 100, f = e); 2190 2191 c && (e = f = b = 0); 2192 2193 this.status.seekPercent = g; 2194 2195 this.status.currentPercentRelative = f; 2196 2197 this.status.currentPercentAbsolute = e; 2198 2199 this.status.currentTime = b; 2200 2201 this.status.remaining = this.status.duration - this.status.currentTime; 2202 2203 this.status.videoWidth = a.videoWidth; 2204 2205 this.status.videoHeight = a.videoHeight; 2206 2207 this.status.readyState = a.readyState; 2208 2209 this.status.networkState = a.networkState; 2210 2211 this.status.playbackRate = a.playbackRate; 2212 2213 this.status.ended = a.ended 2214 2215 }, 2216 2217 _resetStatus: function() 2218 2219 { 2220 2221 this.status = b.extend( 2222 2223 {}, this.status, b.jPlayer.prototype.status) 2224 2225 }, 2226 2227 _trigger: function(a, c, d) 2228 2229 { 2230 2231 a = b.Event(a); 2232 2233 a.jPlayer = {}; 2234 2235 a.jPlayer.version = b.extend( 2236 2237 {}, this.version); 2238 2239 a.jPlayer.options = b.extend(!0, 2240 2241 {}, this.options); 2242 2243 a.jPlayer.status = b.extend(!0, 2244 2245 {}, this.status); 2246 2247 a.jPlayer.html = b.extend(!0, 2248 2249 {}, this.html); 2250 2251 a.jPlayer.flash = b.extend(!0, 2252 2253 {}, this.flash); 2254 2255 c && (a.jPlayer.error = b.extend( 2256 2257 {}, c)); 2258 2259 d && (a.jPlayer.warning = b.extend( 2260 2261 {}, d)); 2262 2263 this.element.trigger(a) 2264 2265 }, 2266 2267 jPlayerFlashEvent: function(a, c) 2268 2269 { 2270 2271 if (a === b.jPlayer.event.ready) 2272 2273 if (!this.internal.ready) this.internal.ready = !0, this.internal 2274 2275 .flash.jq.css( 2276 2277 { 2278 2279 width: "0px", 2280 2281 height: "0px" 2282 2283 }), this.version.flash = c.version, this.version.needFlash !== 2284 2285 this.version.flash && this._error( 2286 2287 { 2288 2289 type: b.jPlayer.error.VERSION, 2290 2291 context: this.version.flash, 2292 2293 message: b.jPlayer.errorMsg.VERSION + this.version.flash, 2294 2295 hint: b.jPlayer.errorHint.VERSION 2296 2297 }), this._trigger(b.jPlayer.event.repeat), this._trigger(a); 2298 2299 else if (this.flash.gate) 2300 2301 { 2302 2303 if (this.status.srcSet) 2304 2305 { 2306 2307 var d = this.status.currentTime, 2308 2309 e = this.status.paused; 2310 2311 this.setMedia(this.status.media); 2312 2313 this.volumeWorker(this.options.volume); 2314 2315 0 < d && (e ? this.pause(d) : this.play(d)) 2316 2317 } 2318 2319 this._trigger(b.jPlayer.event.flashreset) 2320 2321 } 2322 2323 if (this.flash.gate) switch (a) 2324 2325 { 2326 2327 case b.jPlayer.event.progress: 2328 2329 this._getFlashStatus(c); 2330 2331 this._updateInterface(); 2332 2333 this._trigger(a); 2334 2335 break; 2336 2337 case b.jPlayer.event.timeupdate: 2338 2339 this._getFlashStatus(c); 2340 2341 this._updateInterface(); 2342 2343 this._trigger(a); 2344 2345 break; 2346 2347 case b.jPlayer.event.play: 2348 2349 this._seeked(); 2350 2351 this._updateButtons(!0); 2352 2353 this._trigger(a); 2354 2355 break; 2356 2357 case b.jPlayer.event.pause: 2358 2359 this._updateButtons(!1); 2360 2361 this._trigger(a); 2362 2363 break; 2364 2365 case b.jPlayer.event.ended: 2366 2367 this._updateButtons(!1); 2368 2369 this._trigger(a); 2370 2371 break; 2372 2373 case b.jPlayer.event.click: 2374 2375 this._trigger(a); 2376 2377 break; 2378 2379 case b.jPlayer.event.error: 2380 2381 this.status.waitForLoad = !0; 2382 2383 this.status.waitForPlay = !0; 2384 2385 this.status.video && this.internal.flash.jq.css( 2386 2387 { 2388 2389 width: "0px", 2390 2391 height: "0px" 2392 2393 });
2394 2395 this._validString(this.status.media.poster) && this.internal 2396 2397 .poster.jq.show(); 2398 2399 this.css.jq.videoPlay.length && this.status.video && this.css 2400 2401 .jq.videoPlay.show(); 2402 2403 this.status.video ? this._flash_setVideo(this.status.media) : 2404 2405 this._flash_setAudio(this.status.media); 2406 2407 this._updateButtons(!1); 2408 2409 this._error( 2410 2411 { 2412 2413 type: b.jPlayer.error.URL, 2414 2415 context: c.src, 2416 2417 message: b.jPlayer.errorMsg.URL, 2418 2419 hint: b.jPlayer.errorHint.URL 2420 2421 }); 2422 2423 break; 2424 2425 case b.jPlayer.event.seeking: 2426 2427 this._seeking(); 2428 2429 this._trigger(a); 2430 2431 break; 2432 2433 case b.jPlayer.event.seeked: 2434 2435 this._seeked(); 2436 2437 this._trigger(a); 2438 2439 break; 2440 2441 case b.jPlayer.event.ready: 2442 2443 break; 2444 2445 default: 2446 2447 this._trigger(a) 2448 2449 } 2450 2451 return !1 2452 2453 }, 2454 2455 _getFlashStatus: function(a) 2456 2457 { 2458 2459 this.status.seekPercent = a.seekPercent; 2460 2461 this.status.currentPercentRelative = a.currentPercentRelative; 2462 2463 this.status.currentPercentAbsolute = a.currentPercentAbsolute; 2464 2465 this.status.currentTime = a.currentTime; 2466 2467 this.status.duration = a.duration; 2468 2469 this.status.remaining = a.duration - a.currentTime; 2470 2471 this.status.videoWidth = a.videoWidth; 2472 2473 this.status.videoHeight = a.videoHeight; 2474 2475 this.status.readyState = 4; 2476 2477 this.status.networkState = 0; 2478 2479 this.status.playbackRate = 1; 2480 2481 this.status.ended = !1 2482 2483 }, 2484 2485 _updateButtons: function(a) 2486 2487 { 2488 2489 a === f ? a = !this.status.paused : this.status.paused = !a; 2490 2491 this.css.jq.play.length && this.css.jq.pause.length && (a ? ( 2492 2493 this.css.jq.play.hide(), this.css.jq.pause.show()) : (this.css 2494 2495 .jq.play.show(), this.css.jq.pause.hide())); 2496 2497 this.css.jq.restoreScreen.length && this.css.jq.fullScreen.length && 2498 2499 (this.status.noFullWindow ? (this.css.jq.fullScreen.hide(), 2500 2501 this.css.jq.restoreScreen.hide()) : this.options.fullWindow ? 2502 2503 (this.css.jq.fullScreen.hide(), this.css.jq.restoreScreen.show()) : 2504 2505 (this.css.jq.fullScreen.show(), this.css.jq.restoreScreen.hide()) 2506 2507 ); 2508 2509 this.css.jq.repeat.length && this.css.jq.repeatOff.length && ( 2510 2511 this.options.loop ? (this.css.jq.repeat.hide(), this.css.jq.repeatOff 2512 2513 .show()) : (this.css.jq.repeat.show(), this.css.jq.repeatOff 2514 2515 .hide())) 2516 2517 }, 2518 2519 _updateInterface: function() 2520 2521 { 2522 2523 this.css.jq.seekBar.length && this.css.jq.seekBar.width(this.status 2524 2525 .seekPercent + "%"); 2526 2527 this.css.jq.playBar.length && (this.options.smoothPlayBar ? 2528 2529 this.css.jq.playBar.stop().animate( 2530 2531 { 2532 2533 width: this.status.currentPercentAbsolute + "%" 2534 2535 }, 250, "linear") : this.css.jq.playBar.width(this.status.currentPercentRelative + 2536 2537 "%")); 2538 2539 var a = ""; 2540 2541 this.css.jq.currentTime.length && (a = this._convertTime(this.status 2542 2543 .currentTime), a !== this.css.jq.currentTime.text() && this.css 2544 2545 .jq.currentTime.text(this._convertTime(this.status.currentTime)) 2546 2547 ); 2548 2549 var a = "", 2550 2551 a = this.status.duration, 2552 2553 c = this.status.remaining; 2554 2555 this.css.jq.duration.length && ("string" === typeof this.status 2556 2557 .media.duration ? a = this.status.media.duration : ("number" === 2558 2559 typeof this.status.media.duration && (a = this.status.media.duration, 2560 2561 c = a - this.status.currentTime), a = this.options.remainingDuration ? 2562 2563 (0 < c ? "-" : "") + this._convertTime(c) : this._convertTime( 2564 2565 a)), a !== this.css.jq.duration.text() && this.css.jq.duration 2566 2567 .text(a)) 2568 2569 }, 2570 2571 _convertTime: l.prototype.time, 2572 2573 _seeking: function() 2574 2575 { 2576 2577 this.css.jq.seekBar.length && this.css.jq.seekBar.addClass( 2578 2579 "jp-seeking-bg") 2580 2581 }, 2582 2583 _seeked: function() 2584 2585 { 2586 2587 this.css.jq.seekBar.length && this.css.jq.seekBar.removeClass( 2588 2589 "jp-seeking-bg") 2590 2591 }, 2592 2593 _resetGate: function() 2594 2595 { 2596 2597 this.html.audio.gate = !1; 2598 2599 this.html.video.gate = !1; 2600 2601 this.flash.gate = !1 2602 2603 }, 2604 2605 _resetActive: function() 2606 2607 { 2608 2609 this.html.active = !1; 2610 2611 this.flash.active = !1 2612 2613 }, 2614 2615 _escapeHtml: function(a) 2616 2617 { 2618 2619 return a.split("&").join("&").split("<").join("<").split( 2620 2621 ">").join(">").split('"').join(""") 2622 2623 }, 2624 2625 _qualifyURL: function(a) 2626 2627 { 2628 2629 var c = document.createElement("div"); 2630 2631 c.innerHTML = '<a href="' + this._escapeHtml(a) + '">x</a>'; 2632 2633 return c.firstChild.href 2634 2635 }, 2636 2637 _absoluteMediaUrls: function(a) 2638 2639 { 2640 2641 var c = this; 2642 2643 b.each(a, function(b, e) 2644 2645 { 2646 2647 e && c.format[b] && (a[b] = c._qualifyURL(e)) 2648 2649 }); 2650 2651 return a 2652 2653 }, 2654 2655 setMedia: function(a) 2656 2657 { 2658 2659 var c = this, 2660 2661 d = !1, 2662 2663 e = this.status.media.poster !== a.poster; 2664 2665 this._resetMedia();
2666 2667 this._resetGate(); 2668 2669 this._resetActive(); 2670 2671 this.androidFix.setMedia = !1; 2672 2673 this.androidFix.play = !1; 2674 2675 this.androidFix.pause = !1; 2676 2677 a = this._absoluteMediaUrls(a); 2678 2679 b.each(this.formats, function(e, f) 2680 2681 { 2682 2683 var k = "video" === c.format[f].media; 2684 2685 b.each(c.solutions, function(e, g) 2686 2687 { 2688 2689 if (c[g].support[f] && c._validString(a[f])) 2690 2691 { 2692 2693 var l = "html" === g; 2694 2695 k ? (l ? (c.html.video.gate = !0, c._html_setVideo(a), c 2696 2697 .html.active = !0) : (c.flash.gate = !0, c._flash_setVideo( 2698 2699 a), c.flash.active = !0), c.css.jq.videoPlay.length && 2700 2701 c.css.jq.videoPlay.show(), c.status.video = !0) : (l ? 2702 2703 (c.html.audio.gate = !0, c._html_setAudio(a), c.html.active = ! 2704 2705 0, b.jPlayer.platform.android && (c.androidFix.setMedia = ! 2706 2707 0)) : (c.flash.gate = !0, c._flash_setAudio(a), c.flash 2708 2709 .active = !0), c.css.jq.videoPlay.length && c.css.jq.videoPlay 2710 2711 .hide(), c.status.video = !1); 2712 2713 d = !0; 2714 2715 return !1 2716 2717 } 2718 2719 }); 2720 2721 if (d) return !1 2722 2723 }); 2724 2725 d ? (this.status.nativeVideoControls && this.html.video.gate || 2726 2727 !this._validString(a.poster) || (e ? this.htmlElement.poster.src = 2728 2729 a.poster : this.internal.poster.jq.show()), this.css.jq.title 2730 2731 .length && "string" === typeof a.title && (this.css.jq.title.html( 2732 2733 a.title), this.htmlElement.audio && this.htmlElement.audio.setAttribute( 2734 2735 "title", a.title), this.htmlElement.video && this.htmlElement 2736 2737 .video.setAttribute("title", a.title)), this.status.srcSet = ! 2738 2739 0, this.status.media = b.extend( 2740 2741 {}, a), this._updateButtons(!1), this._updateInterface(), 2742 2743 this._trigger(b.jPlayer.event.setmedia)) : this._error( 2744 2745 { 2746 2747 type: b.jPlayer.error.NO_SUPPORT, 2748 2749 context: "{supplied:'" + this.options.supplied + "'}", 2750 2751 message: b.jPlayer.errorMsg.NO_SUPPORT, 2752 2753 hint: b.jPlayer.errorHint.NO_SUPPORT 2754 2755 }) 2756 2757 }, 2758 2759 _resetMedia: function() 2760 2761 { 2762 2763 this._resetStatus(); 2764 2765 this._updateButtons(!1); 2766 2767 this._updateInterface(); 2768 2769 this._seeked(); 2770 2771 this.internal.poster.jq.hide(); 2772 2773 clearTimeout(this.internal.htmlDlyCmdId); 2774 2775 this.html.active ? this._html_resetMedia() : this.flash.active && 2776 2777 this._flash_resetMedia() 2778 2779 }, 2780 2781 clearMedia: function() 2782 2783 { 2784 2785 this._resetMedia();
2786 2787 this.html.active ? this._html_clearMedia() : this.flash.active && 2788 2789 this._flash_clearMedia(); 2790 2791 this._resetGate(); 2792 2793 this._resetActive() 2794 2795 }, 2796 2797 load: function() 2798 2799 { 2800 2801 this.status.srcSet ? this.html.active ? this._html_load() : 2802 2803 this.flash.active && this._flash_load() : this._urlNotSetError( 2804 2805 "load") 2806 2807 }, 2808 2809 focus: function() 2810 2811 { 2812 2813 this.options.keyEnabled && (b.jPlayer.focus = this) 2814 2815 }, 2816 2817 play: function(a) 2818 2819 { 2820 2821 a = "number" === typeof a ? a : NaN; 2822 2823 this.status.srcSet ? (this.focus(), this.html.active ? this._html_play( 2824 2825 a) : this.flash.active && this._flash_play(a)) : this._urlNotSetError( 2826 2827 "play") 2828 2829 }, 2830 2831 videoPlay: function() 2832 2833 { 2834 2835 this.play() 2836 2837 }, 2838 2839 pause: function(a) 2840 2841 { 2842 2843 a = "number" === typeof a ? a : NaN; 2844 2845 this.status.srcSet ? this.html.active ? this._html_pause(a) : 2846 2847 this.flash.active && this._flash_pause(a) : this._urlNotSetError( 2848 2849 "pause") 2850 2851 }, 2852 2853 tellOthers: function(a, c) 2854 2855 { 2856 2857 var d = this, 2858 2859 e = "function" === typeof c, 2860 2861 g = Array.prototype.slice.call(arguments); 2862 2863 "string" === typeof a && (e && g.splice(1, 1), b.each(this.instances, 2864 2865 function() 2866 2867 { 2868 2869 d.element !== this && (e && !c.call(this.data("jPlayer"), d) || 2870 2871 this.jPlayer.apply(this, g)) 2872 2873 })) 2874 2875 }, 2876 2877 pauseOthers: function(a) 2878 2879 { 2880 2881 this.tellOthers("pause", function() 2882 2883 { 2884 2885 return this.status.srcSet 2886 2887 }, a) 2888 2889 }, 2890 2891 stop: function() 2892 2893 { 2894 2895 this.status.srcSet ? this.html.active ? this._html_pause(0) : 2896 2897 this.flash.active && this._flash_pause(0) : this._urlNotSetError( 2898 2899 "stop") 2900 2901 }, 2902 2903 playHead: function(a) 2904 2905 { 2906 2907 a = this._limitValue(a, 0, 100); 2908 2909 this.status.srcSet ? this.html.active ? this._html_playHead(a) : 2910 2911 this.flash.active && this._flash_playHead(a) : this._urlNotSetError( 2912 2913 "playHead") 2914 2915 }, 2916 2917 _muted: function(a) 2918 2919 { 2920 2921 this.mutedWorker(a); 2922 2923 this.options.globalVolume && this.tellOthers("mutedWorker", 2924 2925 function() 2926 2927 { 2928 2929 return this.options.globalVolume 2930 2931 }, a) 2932 2933 }, 2934 2935 mutedWorker: function(a) 2936 2937 { 2938 2939 this.options.muted = a; 2940 2941 this.html.used && this._html_setProperty("muted", a); 2942 2943 this.flash.used && this._flash_mute(a); 2944 2945 this.html.video.gate || this.html.audio.gate || (this._updateMute( 2946 2947 a), this._updateVolume(this.options.volume), this._trigger(b 2948 2949 .jPlayer.event.volumechange)) 2950 2951 }, 2952 2953 mute: function(a) 2954 2955 { 2956 2957 a = a === f ? !0 : !!a; 2958 2959 this._muted(a) 2960 2961 }, 2962 2963 unmute: function(a) 2964 2965 { 2966 2967 a = a === f ? !0 : !!a; 2968 2969 this._muted(!a) 2970 2971 }, 2972 2973 _updateMute: function(a) 2974 2975 { 2976 2977 a === f && (a = this.options.muted); 2978 2979 this.css.jq.mute.length && this.css.jq.unmute.length && (this.status 2980 2981 .noVolume ? (this.css.jq.mute.hide(), this.css.jq.unmute.hide()) : 2982 2983 a ? (this.css.jq.mute.hide(), this.css.jq.unmute.show()) : ( 2984 2985 this.css.jq.mute.show(), this.css.jq.unmute.hide())) 2986 2987 }, 2988 2989 volume: function(a) 2990 2991 { 2992 2993 this.volumeWorker(a); 2994 2995 this.options.globalVolume && this.tellOthers("volumeWorker", 2996 2997 function() 2998 2999 { 3000 3001 return this.options.globalVolume 3002 3003 }, a) 3004 3005 }, 3006 3007 volumeWorker: function(a) 3008 3009 { 3010 3011 a = this._limitValue(a, 0, 1); 3012 3013 this.options.volume = a; 3014 3015 this.html.used && this._html_setProperty("volume", a); 3016 3017 this.flash.used && this._flash_volume(a); 3018 3019 this.html.video.gate || this.html.audio.gate || (this._updateVolume( 3020 3021 a), this._trigger(b.jPlayer.event.volumechange)) 3022 3023 }, 3024 3025 volumeBar: function(a) 3026 3027 { 3028 3029 if (this.css.jq.volumeBar.length) 3030 3031 { 3032 3033 var c = b(a.currentTarget), 3034 3035 d = c.offset(), 3036 3037 e = a.pageX - d.left, 3038 3039 g = c.width(); 3040 3041 a = c.height() - a.pageY + d.top; 3042 3043 c = c.height(); 3044 3045 this.options.verticalVolume ? this.volume(a / c) : this.volume( 3046 3047 e / g) 3048 3049 } 3050 3051 this.options.muted && this._muted(!1) 3052 3053 }, 3054 3055 _updateVolume: function(a) 3056 3057 { 3058 3059 a === f && (a = this.options.volume); 3060 3061 a = this.options.muted ? 0 : a; 3062 3063 this.status.noVolume ? (this.css.jq.volumeBar.length && this.css 3064 3065 .jq.volumeBar.hide(), this.css.jq.volumeBarValue.length && 3066 3067 this.css.jq.volumeBarValue.hide(), this.css.jq.volumeMax.length && 3068 3069 this.css.jq.volumeMax.hide()) : (this.css.jq.volumeBar.length && 3070 3071 this.css.jq.volumeBar.show(), this.css.jq.volumeBarValue.length && 3072 3073 (this.css.jq.volumeBarValue.show(), this.css.jq.volumeBarValue[ 3074 3075 this.options.verticalVolume ? "height" : "width"](100 * a + 3076 3077 "%")), this.css.jq.volumeMax.length && this.css.jq.volumeMax 3078 3079 .show()) 3080 3081 }, 3082 3083 volumeMax: function() 3084 3085 { 3086 3087 this.volume(1); 3088 3089 this.options.muted && this._muted(!1) 3090 3091 }, 3092 3093 _cssSelectorAncestor: function(a) 3094 3095 { 3096 3097 var c = this; 3098 3099 this.options.cssSelectorAncestor = a; 3100 3101 this._removeUiClass(); 3102 3103 this.ancestorJq = a ? b(a) : []; 3104 3105 a && 1 !== this.ancestorJq.length && this._warning( 3106 3107 { 3108 3109 type: b.jPlayer.warning.CSS_SELECTOR_COUNT, 3110 3111 context: a, 3112 3113 message: b.jPlayer.warningMsg.CSS_SELECTOR_COUNT + this.ancestorJq 3114 3115 .length + " found for cssSelectorAncestor.", 3116 3117 hint: b.jPlayer.warningHint.CSS_SELECTOR_COUNT 3118 3119 }); 3120 3121 this._addUiClass(); 3122 3123 b.each(this.options.cssSelector, function(a, b) 3124 3125 { 3126 3127 c._cssSelector(a, b) 3128 3129 }); 3130 3131 this._updateInterface(); 3132 3133 this._updateButtons(); 3134 3135 this._updateAutohide(); 3136 3137 this._updateVolume(); 3138 3139 this._updateMute() 3140 3141 }, 3142 3143 _cssSelector: function(a, c) 3144 3145 { 3146 3147 var d = this; 3148 3149 "string" === typeof c ? b.jPlayer.prototype.options.cssSelector[ 3150 3151 a] ? (this.css.jq[a] && this.css.jq[a].length && this.css.jq[ 3152 3153 a].unbind(".jPlayer"), this.options.cssSelector[a] = c, this 3154 3155 .css.cs[a] = this.options.cssSelectorAncestor + " " + c, this 3156 3157 .css.jq[a] = c ? b(this.css.cs[a]) : [], this.css.jq[a].length && 3158 3159 this[a] && this.css.jq[a].bind("click.jPlayer", function(c) 3160 3161 { 3162 3163 c.preventDefault(); 3164 3165 d[a](c); 3166 3167 b(this).blur() 3168 3169 }), c && 1 !== this.css.jq[a].length && this._warning( 3170 3171 { 3172 3173 type: b.jPlayer.warning.CSS_SELECTOR_COUNT, 3174 3175 context: this.css.cs[a], 3176 3177 message: b.jPlayer.warningMsg.CSS_SELECTOR_COUNT + this.css 3178 3179 .jq[a].length + " found for " + a + " method.", 3180 3181 hint: b.jPlayer.warningHint.CSS_SELECTOR_COUNT 3182 3183 })) : this._warning( 3184 3185 { 3186 3187 type: b.jPlayer.warning.CSS_SELECTOR_METHOD, 3188 3189 context: a, 3190 3191 message: b.jPlayer.warningMsg.CSS_SELECTOR_METHOD, 3192 3193 hint: b.jPlayer.warningHint.CSS_SELECTOR_METHOD 3194 3195 }) : this._warning( 3196 3197 { 3198 3199 type: b.jPlayer.warning.CSS_SELECTOR_STRING, 3200 3201 context: c, 3202 3203 message: b.jPlayer.warningMsg.CSS_SELECTOR_STRING, 3204 3205 hint: b.jPlayer.warningHint.CSS_SELECTOR_STRING 3206 3207 }) 3208 3209 }, 3210 3211 duration: function(a) 3212 3213 { 3214 3215 this.options.toggleDuration && this._setOption( 3216 3217 "remainingDuration", !this.options.remainingDuration) 3218 3219 }, 3220 3221 seekBar: function(a) 3222 3223 { 3224 3225 if (this.css.jq.seekBar.length) 3226 3227 { 3228 3229 var c = b(a.currentTarget), 3230 3231 d = c.offset(); 3232
3233 a = a.pageX - d.left; 3234 3235 c = c.width(); 3236 3237 this.playHead(100 * a / c) 3238 3239 } 3240 3241 }, 3242 3243 playbackRate: function(a) 3244 3245 { 3246 3247 this._setOption("playbackRate", a) 3248 3249 }, 3250 3251 playbackRateBar: function(a) 3252 3253 { 3254 3255 if (this.css.jq.playbackRateBar.length) 3256 3257 { 3258 3259 var c = b(a.currentTarget), 3260 3261 d = c.offset(), 3262 3263 e = a.pageX - d.left, 3264 3265 g = c.width(); 3266 3267 a = c.height() - a.pageY + d.top; 3268 3269 c = c.height(); 3270 3271 this.playbackRate((this.options.verticalPlaybackRate ? a / c : 3272 3273 e / g) * (this.options.maxPlaybackRate - this.options.minPlaybackRate) + 3274 3275 this.options.minPlaybackRate) 3276 3277 } 3278 3279 }, 3280 3281 _updatePlaybackRate: function() 3282 3283 { 3284 3285 var a = (this.options.playbackRate - this.options.minPlaybackRate) / 3286 3287 (this.options.maxPlaybackRate - this.options.minPlaybackRate); 3288 3289 this.status.playbackRateEnabled ? (this.css.jq.playbackRateBar.length && 3290 3291 this.css.jq.playbackRateBar.show(), this.css.jq.playbackRateBarValue 3292 3293 .length && (this.css.jq.playbackRateBarValue.show(), this.css 3294 3295 .jq.playbackRateBarValue[this.options.verticalPlaybackRate ? 3296 3297 "height" : "width"](100 * a + "%"))) : (this.css.jq.playbackRateBar 3298 3299 .length && this.css.jq.playbackRateBar.hide(), this.css.jq.playbackRateBarValue 3300 3301 .length && this.css.jq.playbackRateBarValue.hide()) 3302 3303 }, 3304 3305 repeat: function() 3306 3307 { 3308 3309 this._loop(!0) 3310 3311 }, 3312 3313 repeatOff: function() 3314 3315 { 3316 3317 this._loop(!1) 3318 3319 }, 3320 3321 _loop: function(a) 3322 3323 { 3324 3325 this.options.loop !== a && (this.options.loop = a, this._updateButtons(), 3326 3327 this._trigger(b.jPlayer.event.repeat)) 3328 3329 }, 3330 3331 option: function(a, c) 3332 3333 { 3334 3335 var d = a; 3336 3337 if (0 === arguments.length) return b.extend(!0, 3338 3339 {}, this.options); 3340 3341 if ("string" === typeof a) 3342 3343 { 3344 3345 var e = a.split("."); 3346 3347 if (c === f) 3348 3349 { 3350 3351 for (var d = b.extend(!0, 3352 3353 {}, this.options), g = 0; g < e.length; g++) 3354 3355 if (d[e[g]] !== f) d = d[e[g]]; 3356 3357 else return this._warning( 3358 3359 { 3360 3361 type: b.jPlayer.warning.OPTION_KEY, 3362 3363 context: a, 3364 3365 message: b.jPlayer.warningMsg.OPTION_KEY, 3366 3367 hint: b.jPlayer.warningHint.OPTION_KEY 3368 3369 }), f; 3370 3371 return d 3372 3373 } 3374 3375 for (var g = d = {}, h = 0; h < e.length; h++) h < e.length - 3376 3377 1 ? (g[e[h]] = {}, g = g[e[h]]) : g[e[h]] = c 3378 3379 } 3380 3381 this._setOptions(d); 3382 3383 return this 3384 3385 }, 3386 3387 _setOptions: function(a) 3388 3389 { 3390 3391 var c = this; 3392 3393 b.each(a, function(a, b) 3394 3395 { 3396 3397 c._setOption(a, b) 3398 3399 }); 3400 3401 return this 3402 3403 }, 3404 3405 _setOption: function(a, c) 3406 3407 { 3408 3409 var d = this; 3410 3411 switch (a) 3412 3413 { 3414 3415 case "volume": 3416 3417 this.volume(c); 3418 3419 break; 3420 3421 case "muted": 3422 3423 this._muted(c); 3424 3425 break; 3426 3427 case "globalVolume": 3428 3429 this.options[a] = c; 3430 3431 break; 3432 3433 case "cssSelectorAncestor": 3434 3435 this._cssSelectorAncestor(c); 3436 3437 break; 3438 3439 case "cssSelector": 3440 3441 b.each(c, function(a, c) 3442 3443 { 3444 3445 d._cssSelector(a, c) 3446 3447 }); 3448 3449 break; 3450 3451 case "playbackRate": 3452 3453 this.options[a] = c = this._limitValue(c, this.options.minPlaybackRate, 3454 3455 this.options.maxPlaybackRate); 3456 3457 this.html.used && this._html_setProperty("playbackRate", c); 3458 3459 this._updatePlaybackRate(); 3460 3461 break; 3462 3463 case "defaultPlaybackRate": 3464 3465 this.options[a] = c = this._limitValue(c, this.options.minPlaybackRate, 3466 3467 this.options.maxPlaybackRate); 3468 3469 this.html.used && this._html_setProperty( 3470 3471 "defaultPlaybackRate", c); 3472 3473 this._updatePlaybackRate(); 3474 3475 break; 3476 3477 case "minPlaybackRate": 3478 3479 this.options[a] = c = this._limitValue(c, 0.1, this.options.maxPlaybackRate - 3480 3481 0.1); 3482 3483 this._updatePlaybackRate(); 3484 3485 break; 3486 3487 case "maxPlaybackRate": 3488 3489 this.options[a] = c = this._limitValue(c, this.options.minPlaybackRate + 3490 3491 0.1, 16); 3492 3493 this._updatePlaybackRate(); 3494 3495 break; 3496 3497 case "fullScreen": 3498 3499 if (this.options[a] !== c) 3500 3501 { 3502 3503 var e = b.jPlayer.nativeFeatures.fullscreen.used.webkitVideo; 3504 3505 if (!e || e && !this.status.waitForPlay) e || (this.options[ 3506 3507 a] = c), c ? this._requestFullscreen() : this._exitFullscreen(), 3508 3509 e || this._setOption("fullWindow", c) 3510 3511 } 3512 3513 break; 3514 3515 case "fullWindow": 3516 3517 this.options[a] !== c && (this._removeUiClass(), this.options[ 3518 3519 a] = c, this._refreshSize()); 3520 3521 break; 3522 3523 case "size": 3524 3525 this.options.fullWindow || this.options[a].cssClass === c.cssClass || 3526 3527 this._removeUiClass(); 3528 3529 this.options[a] = b.extend( 3530 3531 {}, this.options[a], c); 3532 3533 this._refreshSize(); 3534 3535 break; 3536 3537 case "sizeFull": 3538 3539 this.options.fullWindow && this.options[a].cssClass !== c.cssClass && 3540 3541 this._removeUiClass(); 3542 3543 this.options[a] = b.extend( 3544 3545 {}, this.options[a], c); 3546 3547 this._refreshSize(); 3548 3549 break; 3550 3551 case "autohide": 3552 3553 this.options[a] = b.extend( 3554 3555 {}, this.options[a], c); 3556 3557 this._updateAutohide(); 3558 3559 break; 3560 3561 case "loop": 3562 3563 this._loop(c); 3564 3565 break; 3566 3567 case "remainingDuration": 3568 3569 this.options[a] = c; 3570 3571 this._updateInterface(); 3572 3573 break; 3574 3575 case "toggleDuration": 3576 3577 this.options[a] = c; 3578 3579 break; 3580 3581 case "nativeVideoControls": 3582 3583 this.options[a] = b.extend( 3584 3585 {}, this.options[a], c); 3586 3587 this.status.nativeVideoControls = this._uaBlocklist(this.options 3588 3589 3590 3591 .nativeVideoControls); 3592 3593 this._restrictNativeVideoControls(); 3594 3595 this._updateNativeVideoControls(); 3596 3597 break; 3598 3599 case "noFullWindow": 3600 3601 this.options[a] = b.extend( 3602 3603 {}, this.options[a], c); 3604 3605 this.status.nativeVideoControls = this._uaBlocklist(this.options 3606 3607 .nativeVideoControls); 3608 3609 this.status.noFullWindow = this._uaBlocklist(this.options.noFullWindow); 3610 3611 this._restrictNativeVideoControls(); 3612 3613 this._updateButtons(); 3614 3615 break; 3616 3617 case "noVolume": 3618 3619 this.options[a] = b.extend( 3620 3621 {}, this.options[a], c); 3622 3623 this.status.noVolume = this._uaBlocklist(this.options.noVolume); 3624 3625 this._updateVolume(); 3626 3627 this._updateMute(); 3628 3629 break; 3630 3631 case "emulateHtml": 3632 3633 this.options[a] !== c && ((this.options[a] = c) ? this._emulateHtmlBridge() : 3634 3635 this._destroyHtmlBridge()); 3636 3637 break; 3638 3639 case "timeFormat": 3640 3641 this.options[a] = b.extend( 3642 3643 {}, this.options[a], c); 3644 3645 break; 3646 3647 case "keyEnabled": 3648 3649 this.options[a] = c; 3650 3651 c || this !== b.jPlayer.focus || (b.jPlayer.focus = null); 3652 3653 break; 3654 3655 case "keyBindings": 3656 3657 this.options[a] = b.extend(!0, 3658 3659 {}, this.options[a], c); 3660 3661 break; 3662 3663 case "audioFullScreen": 3664 3665 this.options[a] = c 3666 3667 } 3668 3669 return this 3670 3671 }, 3672 3673 _refreshSize: function() 3674 3675 { 3676 3677 this._setSize(); 3678 3679 this._addUiClass(); 3680 3681 this._updateSize(); 3682 3683 this._updateButtons(); 3684 3685 this._updateAutohide(); 3686 3687 this._trigger(b.jPlayer.event.resize) 3688 3689 }, 3690 3691 _setSize: function() 3692 3693 { 3694 3695 this.options.fullWindow ? (this.status.width = this.options.sizeFull 3696 3697 .width, this.status.height = this.options.sizeFull.height, 3698 3699 this.status.cssClass = this.options.sizeFull.cssClass) : ( 3700 3701 this.status.width = this.options.size.width, this.status.height = 3702 3703 this.options.size.height, this.status.cssClass = this.options 3704 3705 .size.cssClass); 3706 3707 this.element.css( 3708 3709 { 3710 3711 width: this.status.width, 3712 3713 height: this.status.height 3714 3715 }) 3716 3717 }, 3718 3719 _addUiClass: function() 3720 3721 { 3722 3723 this.ancestorJq.length && this.ancestorJq.addClass(this.status.cssClass) 3724 3725 }, 3726 3727 _removeUiClass: function() 3728 3729 { 3730 3731 this.ancestorJq.length && this.ancestorJq.removeClass(this.status 3732 3733 .cssClass) 3734 3735 }, 3736 3737 _updateSize: function() 3738 3739 { 3740 3741 this.internal.poster.jq.css( 3742 3743 { 3744 3745 width: this.status.width, 3746 3747 height: this.status.height 3748 3749 }); 3750 3751 !this.status.waitForPlay && this.html.active && this.status.video || 3752 3753 this.html.video.available && this.html.used && this.status.nativeVideoControls ? 3754 3755 this.internal.video.jq.css( 3756 3757 { 3758 3759 width: this.status.width, 3760 3761 height: this.status.height 3762 3763 }) : !this.status.waitForPlay && this.flash.active && this.status 3764 3765 .video && this.internal.flash.jq.css( 3766 3767 { 3768 3769 width: this.status.width, 3770 3771 height: this.status.height 3772 3773 }) 3774 3775 }, 3776 3777 _updateAutohide: function() 3778 3779 { 3780 3781 var a = this, 3782 3783 c = function() 3784 3785 { 3786 3787 a.css.jq.gui.fadeIn(a.options.autohide.fadeIn, function() 3788 3789 { 3790 3791 clearTimeout(a.internal.autohideId); 3792 3793 a.internal.autohideId = setTimeout(function() 3794 3795 { 3796 3797 a.css.jq.gui.fadeOut(a.options.autohide.fadeOut) 3798 3799 }, a.options.autohide.hold) 3800 3801 }) 3802 3803 }; 3804 3805 this.css.jq.gui.length && (this.css.jq.gui.stop(!0, !0), 3806 3807 clearTimeout(this.internal.autohideId), this.element.unbind( 3808 3809 ".jPlayerAutohide"), this.css.jq.gui.unbind( 3810 3811 ".jPlayerAutohide"), this.status.nativeVideoControls ? this.css 3812 3813 .jq.gui.hide() : this.options.fullWindow && this.options.autohide 3814 3815 .full || !this.options.fullWindow && this.options.autohide.restored ? 3816 3817 (this.element.bind("mousemove.jPlayer.jPlayerAutohide", c), 3818 3819 this.css.jq.gui.bind("mousemove.jPlayer.jPlayerAutohide", c), 3820 3821 this.css.jq.gui.hide()) : this.css.jq.gui.show()) 3822 3823 }, 3824 3825 fullScreen: function() 3826 3827 { 3828 3829 this._setOption("fullScreen", !0) 3830 3831 }, 3832 3833 restoreScreen: function() 3834 3835 { 3836 3837 this._setOption("fullScreen", !1) 3838 3839 }, 3840 3841 _fullscreenAddEventListeners: function() 3842 3843 { 3844 3845 var a = this, 3846 3847 c = b.jPlayer.nativeFeatures.fullscreen;
3848 3849 c.api.fullscreenEnabled && c.event.fullscreenchange && ( 3850 3851 "function" !== typeof this.internal.fullscreenchangeHandler && 3852 3853 (this.internal.fullscreenchangeHandler = function() 3854 3855 { 3856 3857 a._fullscreenchange() 3858 3859 }), document.addEventListener(c.event.fullscreenchange, this.internal 3860 3861 .fullscreenchangeHandler, !1)) 3862 3863 }, 3864 3865 _fullscreenRemoveEventListeners: function() 3866 3867 { 3868 3869 var a = b.jPlayer.nativeFeatures.fullscreen; 3870 3871 this.internal.fullscreenchangeHandler && document.removeEventListener( 3872 3873 a.event.fullscreenchange, this.internal.fullscreenchangeHandler, ! 3874 3875 1) 3876 3877 }, 3878 3879 _fullscreenchange: function() 3880 3881 { 3882 3883 this.options.fullScreen && !b.jPlayer.nativeFeatures.fullscreen 3884 3885 .api.fullscreenElement() && this._setOption("fullScreen", !1) 3886 3887 }, 3888 3889 _requestFullscreen: function() 3890 3891 { 3892 3893 var a = this.ancestorJq.length ? this.ancestorJq[0] : this.element[ 3894 3895 0], 3896 3897 c = b.jPlayer.nativeFeatures.fullscreen; 3898 3899 c.used.webkitVideo && (a = this.htmlElement.video); 3900 3901 c.api.fullscreenEnabled && c.api.requestFullscreen(a) 3902 3903 }, 3904 3905 _exitFullscreen: function() 3906 3907 { 3908 3909 var a = b.jPlayer.nativeFeatures.fullscreen, 3910 3911 c; 3912 3913 a.used.webkitVideo && (c = this.htmlElement.video); 3914 3915 a.api.fullscreenEnabled && a.api.exitFullscreen(c) 3916 3917 }, 3918 3919 _html_initMedia: function(a) 3920 3921 { 3922 3923 var c = b(this.htmlElement.media).empty(); 3924 3925 b.each(a.track || [], function(a, b) 3926 3927 { 3928 3929 var g = document.createElement("track"); 3930 3931 g.setAttribute("kind", b.kind ? b.kind : ""); 3932 3933 g.setAttribute("src", b.src ? b.src : ""); 3934 3935 g.setAttribute("srclang", b.srclang ? b.srclang : ""); 3936 3937 g.setAttribute("label", b.label ? b.label : ""); 3938 3939 b.def && g.setAttribute("default", b.def); 3940 3941 c.append(g) 3942 3943 }); 3944 3945 this.htmlElement.media.src = this.status.src; 3946 3947 "none" !== this.options.preload && this._html_load(); 3948 3949 this._trigger(b.jPlayer.event.timeupdate) 3950 3951 }, 3952 3953 _html_setFormat: function(a) 3954 3955 { 3956 3957 var c = this; 3958 3959 b.each(this.formats, function(b, e) 3960 3961 { 3962 3963 if (c.html.support[e] && a[e]) return c.status.src = a[e], c 3964 3965 .status.format[e] = !0, c.status.formatType = e, !1 3966 3967 }) 3968 3969 }, 3970 3971 _html_setAudio: function(a) 3972 3973 { 3974 3975 this._html_setFormat(a); 3976 3977 this.htmlElement.media = this.htmlElement.audio; 3978 3979 this._html_initMedia(a) 3980 3981 }, 3982 3983 _html_setVideo: function(a) 3984 3985 { 3986 3987 this._html_setFormat(a); 3988 3989 this.status.nativeVideoControls && (this.htmlElement.video.poster = 3990 3991 this._validString(a.poster) ? a.poster : ""); 3992 3993 this.htmlElement.media = this.htmlElement.video; 3994 3995 this._html_initMedia(a) 3996 3997 }, 3998 3999 _html_resetMedia: function() 4000 4001 { 4002 4003 this.htmlElement.media && (this.htmlElement.media.id !== this.internal 4004 4005 .video.id || this.status.nativeVideoControls || this.internal 4006 4007 .video.jq.css( 4008 4009 { 4010 4011 width: "0px", 4012 4013 height: "0px" 4014 4015 }), this.htmlElement.media.pause()) 4016 4017 }, 4018 4019 _html_clearMedia: function() 4020 4021 { 4022 4023 this.htmlElement.media && (this.htmlElement.media.src = 4024 4025 "about:blank", this.htmlElement.media.load()) 4026 4027 }, 4028 4029 _html_load: function() 4030 4031 { 4032 4033 this.status.waitForLoad && (this.status.waitForLoad = !1, this.htmlElement 4034 4035 .media.load()); 4036 4037 clearTimeout(this.internal.htmlDlyCmdId) 4038 4039 }, 4040 4041 _html_play: function(a) 4042 4043 { 4044 4045 var b = this, 4046 4047 d = this.htmlElement.media; 4048 4049 this.androidFix.pause = !1; 4050 4051 this._html_load(); 4052 4053 if (this.androidFix.setMedia) this.androidFix.play = !0, this.androidFix 4054 4055 .time = a; 4056 4057 else if (isNaN(a)) d.play(); 4058 4059 else 4060 4061 { 4062 4063 this.internal.cmdsIgnored && d.play(); 4064 4065 try 4066 4067 { 4068 4069 if (!d.seekable || "object" === typeof d.seekable && 0 < d.seekable 4070 4071 .length) d.currentTime = a, d.play(); 4072 4073 else throw 1; 4074 4075 } 4076 4077 catch (e) 4078 4079 { 4080 4081 this.internal.htmlDlyCmdId = setTimeout(function() 4082 4083 { 4084 4085 b.play(a) 4086 4087 }, 250); 4088 4089 return 4090 4091 } 4092 4093 } 4094 4095 this._html_checkWaitForPlay() 4096 4097 }, 4098 4099 _html_pause: function(a) 4100 4101 { 4102 4103 var b = this, 4104 4105 d = this.htmlElement.media; 4106 4107 this.androidFix.play = !1; 4108 4109 0 < a ? this._html_load() : clearTimeout(this.internal.htmlDlyCmdId); 4110 4111 d.pause(); 4112 4113 if (this.androidFix.setMedia) this.androidFix.pause = !0, this.androidFix 4114
4115 .time = a; 4116 4117 else if (!isNaN(a)) try 4118 4119 { 4120 4121 if (!d.seekable || "object" === typeof d.seekable && 0 < d.seekable 4122 4123 .length) d.currentTime = a; 4124 4125 else throw 1; 4126 4127 } 4128 4129 catch (e) 4130 4131 { 4132 4133 this.internal.htmlDlyCmdId = setTimeout(function() 4134 4135 { 4136 4137 b.pause(a) 4138 4139 }, 250); 4140 4141 return 4142 4143 } 4144 4145 0 < a && this._html_checkWaitForPlay() 4146 4147 }, 4148 4149 _html_playHead: function(a) 4150 4151 { 4152 4153 var b = this, 4154 4155 d = this.htmlElement.media; 4156 4157 this._html_load(); 4158 4159 try 4160 4161 { 4162 4163 if ("object" === typeof d.seekable && 0 < d.seekable.length) d 4164 4165 .currentTime = a * d.seekable.end(d.seekable.length - 1) / 4166 4167 100; 4168 4169 else if (0 < d.duration && !isNaN(d.duration)) d.currentTime = 4170 4171 a * d.duration / 100; 4172 4173 else throw "e"; 4174 4175 } 4176 4177 catch (e) 4178 4179 { 4180 4181 this.internal.htmlDlyCmdId = setTimeout(function() 4182 4183 { 4184 4185 b.playHead(a) 4186 4187 }, 250); 4188 4189 return 4190 4191 } 4192 4193 this.status.waitForLoad || this._html_checkWaitForPlay() 4194 4195 }, 4196 4197 _html_checkWaitForPlay: function() 4198 4199 { 4200 4201 this.status.waitForPlay && (this.status.waitForPlay = !1, this.css 4202 4203 .jq.videoPlay.length && this.css.jq.videoPlay.hide(), this.status 4204 4205 .video && (this.internal.poster.jq.hide(), this.internal.video 4206 4207 .jq.css( 4208 4209 { 4210 4211 width: this.status.width, 4212 4213 height: this.status.height 4214 4215 }))) 4216 4217 }, 4218 4219 _html_setProperty: function(a, b) 4220 4221 { 4222 4223 this.html.audio.available && (this.htmlElement.audio[a] = b); 4224 4225 this.html.video.available && (this.htmlElement.video[a] = b) 4226 4227 }, 4228 4229 _flash_setAudio: function(a) 4230 4231 { 4232 4233 var c = this; 4234 4235 try 4236 4237 { 4238 4239 b.each(this.formats, function(b, d) 4240 4241 { 4242 4243 if (c.flash.support[d] && a[d]) 4244 4245 { 4246 4247 switch (d) 4248 4249 { 4250 4251 case "m4a": 4252 4253 case "fla": 4254 4255 c._getMovie().fl_setAudio_m4a(a[d]); 4256 4257 break; 4258 4259 case "mp3": 4260 4261 c._getMovie().fl_setAudio_mp3(a[d]); 4262 4263 break; 4264 4265 case "rtmpa": 4266 4267 c._getMovie().fl_setAudio_rtmp(a[d]) 4268 4269 } 4270 4271 c.status.src = a[d]; 4272 4273 c.status.format[d] = !0; 4274 4275 c.status.formatType = d; 4276 4277 return !1 4278 4279 } 4280 4281 }), "auto" === this.options.preload && (this._flash_load(), 4282 4283 this.status.waitForLoad = !1) 4284 4285 } 4286 4287 catch (d) 4288 4289 { 4290 4291 this._flashError(d) 4292 4293 } 4294 4295 }, 4296 4297 _flash_setVideo: function(a) 4298 4299 { 4300 4301 var c = this; 4302 4303 try 4304 4305 { 4306 4307 b.each(this.formats, function(b, d) 4308 4309 { 4310 4311 if (c.flash.support[d] && a[d]) 4312 4313 { 4314 4315 switch (d) 4316 4317 { 4318 4319 case "m4v": 4320 4321 case "flv": 4322 4323 c._getMovie().fl_setVideo_m4v(a[d]); 4324 4325 break; 4326 4327 case "rtmpv": 4328 4329 c._getMovie().fl_setVideo_rtmp(a[d]) 4330 4331 } 4332 4333 c.status.src = a[d]; 4334 4335 c.status.format[d] = !0; 4336 4337 c.status.formatType = d; 4338 4339 return !1 4340 4341 } 4342 4343 }), "auto" === this.options.preload && (this._flash_load(), 4344 4345 this.status.waitForLoad = !1) 4346 4347 } 4348 4349 catch (d) 4350 4351 { 4352 4353 this._flashError(d) 4354 4355 } 4356 4357 }, 4358 4359 _flash_resetMedia: function() 4360 4361 { 4362 4363 this.internal.flash.jq.css( 4364 4365 { 4366 4367 width: "0px", 4368 4369 height: "0px" 4370 4371 }); 4372 4373 this._flash_pause(NaN) 4374 4375 }, 4376 4377 _flash_clearMedia: function() 4378 4379 { 4380 4381 try 4382 4383 { 4384 4385 this._getMovie().fl_clearMedia() 4386 4387 } 4388 4389 catch (a) 4390 4391 { 4392 4393 this._flashError(a) 4394 4395 } 4396 4397 }, 4398 4399 _flash_load: function() 4400 4401 { 4402 4403 try 4404 4405 { 4406 4407 this._getMovie().fl_load() 4408 4409 } 4410 4411 catch (a) 4412 4413 { 4414 4415 this._flashError(a) 4416 4417 } 4418 4419 this.status.waitForLoad = !1 4420 4421 }, 4422 4423 _flash_play: function(a) 4424 4425 { 4426 4427 try 4428 4429 { 4430 4431 this._getMovie().fl_play(a) 4432 4433 } 4434 4435 catch (b) 4436 4437 { 4438 4439 this._flashError(b) 4440 4441 } 4442 4443 this.status.waitForLoad = !1; 4444 4445 this._flash_checkWaitForPlay() 4446 4447 }, 4448 4449 _flash_pause: function(a) 4450 4451 { 4452 4453 try 4454 4455 { 4456 4457 this._getMovie().fl_pause(a) 4458 4459 } 4460 4461 catch (b) 4462 4463 { 4464 4465 this._flashError(b) 4466 4467 } 4468 4469 0 < a && (this.status.waitForLoad = !1, this._flash_checkWaitForPlay()) 4470 4471 }, 4472 4473 _flash_playHead: function(a) 4474 4475 { 4476 4477 try 4478 4479 { 4480 4481 this._getMovie().fl_play_head(a) 4482 4483 } 4484 4485 catch (b) 4486 4487 { 4488 4489 this._flashError(b) 4490 4491 } 4492 4493 this.status.waitForLoad || this._flash_checkWaitForPlay() 4494 4495 }, 4496 4497 _flash_checkWaitForPlay: function() 4498 4499 { 4500 4501 this.status.waitForPlay && (this.status.waitForPlay = !1, this.css 4502 4503 .jq.videoPlay.length && this.css.jq.videoPlay.hide(), this.status 4504 4505 .video && (this.internal.poster.jq.hide(), this.internal.flash 4506 4507 .jq.css( 4508 4509 { 4510 4511 width: this.status.width, 4512 4513 height: this.status.height 4514 4515 }
4515))) 4516 4517 }, 4518 4519 _flash_volume: function(a) 4520 4521 { 4522 4523 try 4524 4525 { 4526 4527 this._getMovie().fl_volume(a) 4528 4529 } 4530 4531 catch (b) 4532 4533 { 4534 4535 this._flashError(b) 4536 4537 } 4538 4539 }, 4540 4541 _flash_mute: function(a) 4542 4543 { 4544 4545 try 4546 4547 { 4548 4549 this._getMovie().fl_mute(a) 4550 4551 } 4552 4553 catch (b) 4554 4555 { 4556 4557 this._flashError(b) 4558 4559 } 4560 4561 }, 4562 4563 _getMovie: function() 4564 4565 { 4566 4567 return document[this.internal.flash.id] 4568 4569 }, 4570 4571 _getFlashPluginVersion: function() 4572 4573 { 4574 4575 var a = 0, 4576 4577 b; 4578 4579 if (window.ActiveXObject) try 4580 4581 { 4582 4583 if (b = new ActiveXObject("ShockwaveFlash.ShockwaveFlash")) 4584 4585 { 4586 4587 var d = b.GetVariable("$version"); 4588 4589 d && (d = d.split(" ")[1].split(","), a = parseInt(d[0], 10) + 4590 4591 "." + parseInt(d[1], 10)) 4592 4593 } 4594 4595 } 4596 4597 catch (e) 4598 4599 {} 4600 4601 else navigator.plugins && 0 < navigator.mimeTypes.length && (b = 4602 4603 navigator.plugins["Shockwave Flash"]) && (a = navigator.plugins[ 4604 4605 "Shockwave Flash"].description.replace(/.*\s(\d+\.\d+).*/, 4606 4607 "$1")); 4608 4609 return 1 * a 4610 4611 }, 4612 4613 _checkForFlash: function(a) 4614 4615 { 4616 4617 var b = !1; 4618 4619 this._getFlashPluginVersion() >= a && (b = !0); 4620 4621 return b 4622 4623 }, 4624 4625 _validString: function(a) 4626 4627 { 4628 4629 return a && "string" === typeof a 4630 4631 }, 4632 4633 _limitValue: function(a, b, d) 4634 4635 { 4636 4637 return a < b ? b : a > d ? d : a 4638 4639 }, 4640 4641 _urlNotSetError: function(a) 4642 4643 { 4644 4645 this._error( 4646 4647 { 4648 4649 type: b.jPlayer.error.URL_NOT_SET, 4650 4651 context: a, 4652 4653 message: b.jPlayer.errorMsg.URL_NOT_SET, 4654 4655 hint: b.jPlayer.errorHint.URL_NOT_SET 4656 4657 }) 4658 4659 }, 4660 4661 _flashError: function(a) 4662 4663 { 4664 4665 var c; 4666 4667 c = this.internal.ready ? "FLASH_DISABLED" : "FLASH"; 4668 4669 this._error( 4670 4671 { 4672 4673 type: b.jPlayer.error[c], 4674 4675 context: this.internal.flash.swf, 4676 4677 message: b.jPlayer.errorMsg[c] + a.message, 4678 4679 hint: b.jPlayer.errorHint[c] 4680 4681 }); 4682 4683 this.internal.flash.jq.css( 4684 4685 { 4686 4687 width: "1px", 4688 4689 height: "1px" 4690 4691 }) 4692 4693 }, 4694 4695 _error: function(a) 4696 4697 { 4698 4699 this._trigger(b.jPlayer.event.error, a); 4700 4701 this.options.errorAlerts && this._alert("Error!" + (a.message ? 4702 4703 "\n" + a.message : "") + (a.hint ? "\n" + a.hint : "") + 4704 4705 "\nContext: " + a.context) 4706 4707 }, 4708 4709 _warning: function(a) 4710 4711 { 4712 4713 this._trigger(b.jPlayer.event.warning, f, a); 4714 4715 this.options.warningAlerts && this._alert("Warning!" + (a.message ? 4716 4717 "\n" + a.message : "") + (a.hint ? "\n" + a.hint : "") + 4718 4719 "\nContext: " + a.context) 4720 4721 }, 4722 4723 _alert: function(a) 4724 4725 { 4726 4727 a = "jPlayer " + this.version.script + " : id='" + this.internal 4728 4729 .self.id + "' : " + a; 4730 4731 this.options.consoleAlerts ? window.console && window.console.log && 4732 4733 window.console.log(a) : alert(a) 4734 4735 }, 4736 4737 _emulateHtmlBridge: function() 4738 4739 { 4740 4741 var a = this; 4742 4743 b.each(b.jPlayer.emulateMethods.split(/\s+/g), function(b, d) 4744 4745 { 4746 4747 a.internal.domNode[d] = function(b) 4748 4749 { 4750 4751 a[d](b) 4752 4753 } 4754 4755 }); 4756 4757 b.each(b.jPlayer.event, function(c, d) 4758 4759 { 4760 4761 var e = !0; 4762 4763 b.each(b.jPlayer.reservedEvent.split(/\s+/g), function(a, b) 4764 4765 { 4766 4767 if (b === c) return e = !1 4768 4769 }); 4770 4771 e && a.element.bind(d + ".jPlayer.jPlayerHtml", function() 4772 4773 { 4774 4775 a._emulateHtmlUpdate(); 4776 4777 var b = document.createEvent("Event"); 4778 4779 b.initEvent(c, !1, !0); 4780 4781 a.internal.domNode.dispatchEvent(b) 4782 4783 }) 4784 4785 }) 4786 4787 }, 4788 4789 _emulateHtmlUpdate: function() 4790 4791 { 4792 4793 var a = this; 4794 4795 b.each(b.jPlayer.emulateStatus.split(/\s+/g), function(b, d) 4796 4797 { 4798 4799 a.internal.domNode[d] = a.status[d] 4800 4801 }); 4802 4803 b.each(b.jPlayer.emulateOptions.split(/\s+/g), function(b, d) 4804 4805 { 4806 4807 a.internal.domNode[d] = a.options[d] 4808 4809 }) 4810 4811 }, 4812 4813 _destroyHtmlBridge: function() 4814 4815 { 4816 4817 var a = this; 4818 4819 this.element.unbind(".jPlayerHtml"); 4820 4821 b.each((b.jPlayer.emulateMethods + " " + b.jPlayer.emulateStatus + 4822 4823 " " + b.jPlayer.emulateOptions).split(/\s+/g), function(b, d) 4824 4825 { 4826 4827 delete a.internal.domNode[d] 4828 4829 }) 4830 4831 } 4832 4833 }; 4834 4835 b.jPlayer.error = { 4836 4837 FLASH: "e_flash", 4838 4839 FLASH_DISABLED: "e_flash_disabled", 4840 4841 NO_SOLUTION: "e_no_solution", 4842 4843 NO_SUPPORT: "e_no_support", 4844 4845 URL: "e_url", 4846 4847 URL_NOT_SET: "e_url_not_set", 4848 4849 VERSION: "e_version" 4850 4851 }; 4852 4853 b.jPlayer.errorMsg = { 4854 4855 FLASH: "jPlayer's Flash fallback is not configured correctly, || a command was issued before the jPlayer Ready event. Details: ", 4856 4857 FLASH_DISABLED: "jPlayer's Flash fallback has been disabled by the browser due to the CSS rules you have used. Details: ", 4858 4859 NO_SOLUTION: "No solution can be found by jPlayer in this browser. Neither HTML nor Flash can be used.", 4860 4861 NO_SUPPORT: "It is not possible to play any media format provided in setMedia() on this browser using your current options.", 4862 4863 URL: "Media URL could not be loaded.", 4864 4865 URL_NOT_SET: "Attempt to issue media playback commands, while no media url is set.", 4866 4867 VERSION: "jPlayer " + b.jPlayer.prototype.version.script + 4868 4869 " needs Jplayer.swf version " + b.jPlayer.prototype.version.needFlash + 4870 4871 " but found " 4872 4873 }; 4874 4875 b.jPlayer.errorHint = { 4876 4877 FLASH: "Check your swfPath option and that Jplayer.swf is there.", 4878 4879 FLASH_DISABLED: "Check that you have not display:none; the jPlayer entity || any ancestor.", 4880 4881 NO_SOLUTION: "Review the jPlayer options: support and supplied.", 4882 4883 NO_SUPPORT: "Video || audio formats defined in the supplied option are missing.", 4884 4885 URL: "Check media URL is valid.", 4886 4887 URL_NOT_SET: "Use setMedia() to set the media URL.", 4888 4889 VERSION: "Update jPlayer files." 4890 4891 }; 4892 4893 b.jPlayer.warning = { 4894 4895 CSS_SELECTOR_COUNT: "e_css_selector_count", 4896 4897 CSS_SELECTOR_METHOD: "e_css_selector_method", 4898 4899 CSS_SELECTOR_STRING: "e_css_selector_string", 4900 4901 OPTION_KEY: "e_option_key" 4902 4903 }; 4904 4905 b.jPlayer.warningMsg = { 4906 4907 CSS_SELECTOR_COUNT: "The number of css selectors found did not equal one: ", 4908 4909 CSS_SELECTOR_METHOD: "The methodName given in jPlayer('cssSelector') is not a valid jPlayer method.", 4910 4911 CSS_SELECTOR_STRING: "The methodCssSelector given in jPlayer('cssSelector') is not a String || is empty.", 4912 4913 OPTION_KEY: "The option requested in jPlayer('option') is undefined." 4914 4915 }; 4916 4917 b.jPlayer.warningHint = { 4918 4919 CSS_SELECTOR_COUNT: "Check your css selector and the ancestor.", 4920
4921 CSS_SELECTOR_METHOD: "Check your method name.", 4922 4923 CSS_SELECTOR_STRING: "Check your css selector is a string.", 4924 4925 OPTION_KEY: "Check your option name." 4926 4927 } 4928 4929});
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.