From c34fe2bcfa9f5de139c3bd3e9b76729284097ec8 Mon Sep 17 00:00:00 2001 From: lipangit <1066666651@qq.com> Date: Thu, 17 Dec 2020 05:39:09 +0800 Subject: [PATCH 01/10] urls --- demo/src/main/java/cn/jzvd/demo/Urls.java | 156 -------------------- demo/src/main/java/org/jzvd/jzvideo/urls.kt | 94 +++++++++++- 2 files changed, 89 insertions(+), 161 deletions(-) diff --git a/demo/src/main/java/cn/jzvd/demo/Urls.java b/demo/src/main/java/cn/jzvd/demo/Urls.java index ed3226a6..dfbfedfd 100644 --- a/demo/src/main/java/cn/jzvd/demo/Urls.java +++ b/demo/src/main/java/cn/jzvd/demo/Urls.java @@ -28,164 +28,8 @@ public class Urls { "http://jzvd-pic.nathen.cn/jzvd-pic/f03cee95-9b78-4dd5-986f-d162c06c385c.png", "http://jzvd-pic.nathen.cn/jzvd-pic/e7ea659f-c3d2-4979-9ea5-f993b05e5930.png", "" - }; - - public static String[][] videoUrls = { - { - "http://jzvd.nathen.cn/6ea7357bc3fa4658b29b7933ba575008/fbbba953374248eb913cb1408dc61d85-5287d2089db37e62345123a1be272f8b.mp4", - "http://jzvd.nathen.cn/35b3dc97fbc240219961bd1fccc6400b/8d9b76ab5a584bce84a8afce012b72d3-5287d2089db37e62345123a1be272f8b.mp4", - "http://jzvd.nathen.cn/df6096e7878541cbbea3f7298683fbed/ef76450342914427beafe9368a4e0397-5287d2089db37e62345123a1be272f8b.mp4", - "http://jzvd.nathen.cn/384d341e000145fb82295bdc54ecef88/103eab5afca34baebc970378dd484942-5287d2089db37e62345123a1be272f8b.mp4", - "http://jzvd.nathen.cn/f55530ba8a59403da0621cbf4faef15e/adae4f2e3ecf4ea780beb057e7bce84c-5287d2089db37e62345123a1be272f8b.mp4", - "http://jzvd.nathen.cn/6340efd1962946ad80eeffd19b3be89c/65b499c0f16e4dd8900497e51ffa0949-5287d2089db37e62345123a1be272f8b.mp4", - "http://jzvd.nathen.cn/f07fa9fddd1e45a6ae1570c7fe7967c1/c6db82685b894e25b523b1cb28d79f2e-5287d2089db37e62345123a1be272f8b.mp4", - "http://jzvd.nathen.cn/d2e969f2ec734520b46ab0965d2b68bd/f124edfef6c24be8b1a7b7f996ccc5e0-5287d2089db37e62345123a1be272f8b.mp4", - "http://jzvd.nathen.cn/4f965ad507ef4194a60a943a34cfe147/32af151ea132471f92c9ced2cff785ea-5287d2089db37e62345123a1be272f8b.mp4", - "http://jzvd.nathen.cn/342a5f7ef6124a4a8faf00e738b8bee4/cf6d9db0bd4d41f59d09ea0a81e918fd-5287d2089db37e62345123a1be272f8b.mp4" - }, - { - "http://jzvd.nathen.cn/623f75c3beea4b1781ea37940e70bbe4/b9cee3fd1a09487ca99ef789cdc41312-5287d2089db37e62345123a1be272f8b.mp4", - "http://jzvd.nathen.cn/d8c137ceba9849f8b2f454a55a96266f/910c8381ff894905b5bc272f8194382a-5287d2089db37e62345123a1be272f8b.mp4", - "http://jzvd.nathen.cn/b8a589e5f12c45fdad96674d08affd31/f1d7229f553f414283033af3e292c6c9-5287d2089db37e62345123a1be272f8b.mp4", - "http://jzvd.nathen.cn/8abcdf98ec6a418b945a70fe9dd6fc7f/5cb36416a23a4da8b15d3eaa5e19a1e6-5287d2089db37e62345123a1be272f8b.mp4" - }, - { - "http://jzvd.nathen.cn/1b61da23555d4ce28c805ea303711aa5/7a33ac2af276441bb4b9838f32d8d710-5287d2089db37e62345123a1be272f8b.mp4", - "http://jzvd.nathen.cn/d525f756aabf4b0588c2152fb94e07f5/d9f59bef829a472a9ca066620d9b871a-5287d2089db37e62345123a1be272f8b.mp4", - "http://jzvd.nathen.cn/6e2fdec45dfa44a6802e95f8e4bc3280/a6a5273ac4244333923991be0583ffc7-5287d2089db37e62345123a1be272f8b.mp4", - "http://jzvd.nathen.cn/22b4de0e2b1245959c5baa77fe0bf14e/896a137559084b7eb879f5441faff20d-5287d2089db37e62345123a1be272f8b.mp4" - }, - {//tiktok - "http://jzvd.nathen.cn/video/1137e480-170bac9c523-0007-1823-c86-de200.mp4", - "http://jzvd.nathen.cn/video/e0bd348-170bac9c3b8-0007-1823-c86-de200.mp4", - "http://jzvd.nathen.cn/video/7bf938c-170bac9c18a-0007-1823-c86-de200.mp4", - "http://jzvd.nathen.cn/video/2f03c005-170bac9abac-0007-1823-c86-de200.mp4", - "http://jzvd.nathen.cn/video/47788f38-170bac9ab8a-0007-1823-c86-de200.mp4", - "http://jzvd.nathen.cn/video/2d6ffe8f-170bac9ab87-0007-1823-c86-de200.mp4", - "http://jzvd.nathen.cn/video/633e0ce-170bac9ab65-0007-1823-c86-de200.mp4", - "http://jzvd.nathen.cn/video/2d6ffe8f-170bac9ab87-0007-1823-c86-de200.mp4", - "http://jzvd.nathen.cn/video/51f7552c-170bac98718-0007-1823-c86-de200.mp4", - "http://jzvd.nathen.cn/video/2a101070-170bad88892-0007-1823-c86-de200.mp4" - } - }; - public static String[][] videoPosters = { - { - "http://jzvd-pic.nathen.cn/jzvd-pic/bd7ffc84-8407-4037-a078-7d922ce0fb0f.jpg", - "http://jzvd-pic.nathen.cn/jzvd-pic/f2dbd12e-b1cb-4daf-aff1-8c6be2f64d1a.jpg", - "http://jzvd-pic.nathen.cn/jzvd-pic/ccd86ca1-66c7-4331-9450-a3b7f765424a.png", - "http://jzvd-pic.nathen.cn/jzvd-pic/2adde364-9be1-4864-b4b9-0b0bcc81ef2e.jpg", - "http://jzvd-pic.nathen.cn/jzvd-pic/2a877211-4b68-4e3a-87be-6d2730faef27.png", - "http://jzvd-pic.nathen.cn/jzvd-pic/aaeb5da9-ac50-4712-a28d-863fe40f1fc6.png", - "http://jzvd-pic.nathen.cn/jzvd-pic/e565f9cc-eedc-45f0-99f8-5b0fa3aed567%281%29.jpg", - "http://jzvd-pic.nathen.cn/jzvd-pic/3430ec64-e6a7-4d8e-b044-9d408e075b7c.jpg", - "http://jzvd-pic.nathen.cn/jzvd-pic/2204a578-609b-440e-8af7-a0ee17ff3aee.jpg", - "http://jzvd-pic.nathen.cn/jzvd-pic/1bb2ebbe-140d-4e2e-abd2-9e7e564f71ac.png" - }, - { - "http://jzvd-pic.nathen.cn/jzvd-pic/f18ee453-6aec-40a5-a046-3203111dd303.jpg", - "http://jzvd-pic.nathen.cn/jzvd-pic/00f5a243-1e9f-426c-94f4-888971987edb.jpg", - "http://jzvd-pic.nathen.cn/jzvd-pic/7df34ee9-1e4f-48f4-8acd-748c52368298.jpg", - "http://jzvd-pic.nathen.cn/jzvd-pic/ef46e139-e378-4298-8441-144888294f1f.png" - }, - { - "http://jzvd-pic.nathen.cn/jzvd-pic/0e58101d-5b47-4100-8fb3-0cce057fd622.jpg", - "http://jzvd-pic.nathen.cn/jzvd-pic/d6d3a520-b183-4867-8746-5b6aba6c1724.png", - "http://jzvd-pic.nathen.cn/jzvd-pic/caa3dade-5744-486d-a1b7-9780aebb9eb5.jpg", - "http://jzvd-pic.nathen.cn/jzvd-pic/2c3e62bb-6a32-4fb0-a1d5-d1260ad436a4.png" - }, - { - "http://jzvd.nathen.cn/snapshot/5f1bf07d953d4e50989e99cb45ba6b5d00002.jpg", - "http://jzvd.nathen.cn/snapshot/c0d873f60f664bf6a90c9a69bdf52be900002.jpg", - "http://jzvd.nathen.cn/snapshot/c8598fcf365542a28be332c19d666ec600002.jpg", - "http://jzvd.nathen.cn/snapshot/f2e9d9cb796f420faa0903a28800660e00001.jpg", - "http://jzvd.nathen.cn/snapshot/b3bb3dd69c804993bbd155225b873bdf00002.jpg", - "http://jzvd.nathen.cn/snapshot/43902ca792e84b1b8bee65e28a75177200001.jpg", - "http://jzvd.nathen.cn/snapshot/e027c24371d84a6296d824dc7a7d0aa600002.jpg", - "http://jzvd.nathen.cn/snapshot/c904a0e5627f4a48982c7d09c5dc79ec00001.jpg", - "http://jzvd.nathen.cn/snapshot/b6eacc0aae6049afbcf7cb9365c7694200002.jpg", - "http://jzvd.nathen.cn/snapshot/717f9195bac04ea589692a3143aa04b400002.jpg" - } }; - public static String[][] videoTitles = { - { - "饺子出来", - "饺子溢出", - "饺子我姓王", - "饺子趴好了", - "饺子很渴", - "饺子这样不好", - "饺子别笑", - "饺子坐火车", - "饺子打游戏", - "饺子快长大" - }, - { - "饺子堵车了", - "饺子喝点", - "饺子快走", - "饺子别这样" - }, - { - "饺子想偷", - "饺子害羞了", - "饺子淡定", - "饺子好喜欢" - } - }; - - - public static String[] ssVideos = { - "http://videos.jzvd.org/ldj/01-ldj.mp4", - "http://videos.jzvd.org/ldj/02-ldj.mp4", - "http://videos.jzvd.org/ldj/03-ldj.mp4", - "http://videos.jzvd.org/ldj/04-ldj.mp4", - "http://videos.jzvd.org/ldj/05-ldj.mp4", - "http://videos.jzvd.org/ldj/06-ldj.mp4", - "http://videos.jzvd.org/ldj/07-ldj.mp4", - "http://videos.jzvd.org/ldj/08-ldj.mp4", - "http://videos.jzvd.org/ldj/09-ldj.mp4", - - "http://videos.jzvd.org/ldj/10-ldj.mp4", - "http://videos.jzvd.org/ldj/11-ldj.mp4", - "http://videos.jzvd.org/ldj/12-ldj.mp4", - "http://videos.jzvd.org/ldj/13-ldj.mp4", - "http://videos.jzvd.org/ldj/14-ldj.mp4", - "http://videos.jzvd.org/ldj/15-ldj.mp4", - "http://videos.jzvd.org/ldj/16-ldj.mp4", - "http://videos.jzvd.org/ldj/17-ldj.mp4", - "http://videos.jzvd.org/ldj/18-ldj.mp4", - "http://videos.jzvd.org/ldj/19-ldj.mp4", - - "http://videos.jzvd.org/ldj/20-ldj.mp4", - "http://videos.jzvd.org/ldj/21-ldj.mp4", - "http://videos.jzvd.org/ldj/22-ldj.mp4", - "http://videos.jzvd.org/ldj/23-ldj.mp4", - "http://videos.jzvd.org/ldj/24-ldj.mp4", - "http://videos.jzvd.org/ldj/25-ldj.mp4", - "http://videos.jzvd.org/ldj/26-ldj.mp4", - "http://videos.jzvd.org/ldj/27-ldj.mp4", - "http://videos.jzvd.org/ldj/28-ldj.mp4", - "http://videos.jzvd.org/ldj/29-ldj.mp4", - - "http://videos.jzvd.org/ldj/30-ldj.mp4", - "http://videos.jzvd.org/ldj/31-ldj.mp4", - "http://videos.jzvd.org/ldj/32-ldj.mp4", - "http://videos.jzvd.org/ldj/33-ldj.mp4", - "http://videos.jzvd.org/ldj/34-ldj.mp4", - "http://videos.jzvd.org/ldj/35-ldj.mp4", - "http://videos.jzvd.org/ldj/36-ldj.mp4", - "http://videos.jzvd.org/ldj/37-ldj.mp4", - "http://videos.jzvd.org/ldj/38-ldj.mp4", - "http://videos.jzvd.org/ldj/39-ldj.mp4", - - "http://videos.jzvd.org/ldj/40-ldj.mp4", - "http://videos.jzvd.org/ldj/41-ldj.mp4", - "http://videos.jzvd.org/ldj/42-ldj.mp4", - "http://videos.jzvd.org/ldj/43-ldj.mp4", - "http://videos.jzvd.org/ldj/44-ldj.mp4", - "http://videos.jzvd.org/ldj/45-ldj.mp4", - }; } diff --git a/demo/src/main/java/org/jzvd/jzvideo/urls.kt b/demo/src/main/java/org/jzvd/jzvideo/urls.kt index cc0e799a..0be80a6a 100644 --- a/demo/src/main/java/org/jzvd/jzvideo/urls.kt +++ b/demo/src/main/java/org/jzvd/jzvideo/urls.kt @@ -50,15 +50,99 @@ val ldjVideos = arrayOf( ) val videos = arrayOf( - "", - "" + "http://videos.jzvd.org/v/饺子还年轻.mp4", + "http://videos.jzvd.org/v/饺子主动.mp4", + "http://videos.jzvd.org/v/饺子真萌.mp4", + "http://videos.jzvd.org/v/饺子真会.mp4", + "http://videos.jzvd.org/v/饺子运动.mp4", + "http://videos.jzvd.org/v/饺子有活.mp4", + "http://videos.jzvd.org/v/饺子星光.mp4", + "http://videos.jzvd.org/v/饺子想听.mp4", + "http://videos.jzvd.org/v/饺子想吹.mp4", + "http://videos.jzvd.org/v/饺子汪汪.mp4", + "http://videos.jzvd.org/v/饺子偷人.mp4", + "http://videos.jzvd.org/v/饺子挺住.mp4", + "http://videos.jzvd.org/v/饺子跳.mp4", + "http://videos.jzvd.org/v/饺子受不了.mp4", + "http://videos.jzvd.org/v/饺子三位.mp4", + "http://videos.jzvd.org/v/饺子起飞.mp4", + "http://videos.jzvd.org/v/饺子你听.mp4", + "http://videos.jzvd.org/v/饺子可以了.mp4", + "http://videos.jzvd.org/v/饺子可以.mp4", + "http://videos.jzvd.org/v/饺子好妈妈.mp4", + "http://videos.jzvd.org/v/饺子还小.mp4", + "http://videos.jzvd.org/v/饺子高兴.mp4", + "http://videos.jzvd.org/v/饺子高冷.mp4", + "http://videos.jzvd.org/v/饺子堵住了.mp4", + "http://videos.jzvd.org/v/饺子都懂.mp4", + "http://videos.jzvd.org/v/饺子打电话.mp4", + "http://videos.jzvd.org/v/饺子不服.mp4" ) val thumbnails = arrayOf( - "", - "" + "http://videos.jzvd.org/v/饺子还年轻.jpg", + "http://videos.jzvd.org/v/饺子主动.jpg", + "http://videos.jzvd.org/v/饺子真萌.jpg", + "http://videos.jzvd.org/v/饺子真会.jpg", + "http://videos.jzvd.org/v/饺子运动.jpg", + "http://videos.jzvd.org/v/饺子有活.jpg", + "http://videos.jzvd.org/v/饺子星光.jpg", + "http://videos.jzvd.org/v/饺子想听.jpg", + "http://videos.jzvd.org/v/饺子想吹.jpg", + "http://videos.jzvd.org/v/饺子汪汪.jpg", + "http://videos.jzvd.org/v/饺子偷人.jpg", + "http://videos.jzvd.org/v/饺子挺住.jpg", + "http://videos.jzvd.org/v/饺子跳.jpg", + "http://videos.jzvd.org/v/饺子受不了.jpg", + "http://videos.jzvd.org/v/饺子三位.jpg", + "http://videos.jzvd.org/v/饺子起飞.jpg", + "http://videos.jzvd.org/v/饺子你听.jpg", + "http://videos.jzvd.org/v/饺子可以了.jpg", + "http://videos.jzvd.org/v/饺子可以.jpg", + "http://videos.jzvd.org/v/饺子好妈妈.jpg", + "http://videos.jzvd.org/v/饺子还小.jpg", + "http://videos.jzvd.org/v/饺子高兴.jpg", + "http://videos.jzvd.org/v/饺子高冷.jpg", + "http://videos.jzvd.org/v/饺子堵住了.jpg", + "http://videos.jzvd.org/v/饺子都懂.jpg", + "http://videos.jzvd.org/v/饺子打电话.jpg", + "http://videos.jzvd.org/v/饺子不服.jpg" ) -val someUrls = ldjVideos.copyOfRange(3, 9) +val titles = arrayOf( + "饺子还年轻", + "饺子主动", + "饺子真萌", + "饺子真会", + "饺子运动", + "饺子有活", + "饺子星光", + "饺子想听", + "饺子想吹", + "饺子汪汪", + "饺子偷人", + "饺子挺住", + "饺子跳", + "饺子受不了", + "饺子三位", + "饺子起飞", + "饺子你听", + "饺子可以了", + "饺子可以", + "饺子好妈妈", + "饺子还小", + "饺子高兴", + "饺子高冷", + "饺子堵住了", + "饺子都懂", + "饺子打电话", + "饺子不服" +) + +val list1 = videos.copyOfRange(3, 9) +val list2 = videos.copyOfRange(1, 6) +val list3 = videos.copyOfRange(0, 3) + + From 012f602460737abb55f963b34d974e6ee8754082 Mon Sep 17 00:00:00 2001 From: lipangit <1066666651@qq.com> Date: Fri, 18 Dec 2020 01:41:07 +0800 Subject: [PATCH 02/10] all urls --- demo/src/main/java/org/jzvd/jzvideo/urls.kt | 90 ++++++++++----------- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/demo/src/main/java/org/jzvd/jzvideo/urls.kt b/demo/src/main/java/org/jzvd/jzvideo/urls.kt index 0be80a6a..ee5d4aea 100644 --- a/demo/src/main/java/org/jzvd/jzvideo/urls.kt +++ b/demo/src/main/java/org/jzvd/jzvideo/urls.kt @@ -2,51 +2,51 @@ package org.jzvd.jzvideo val ldjVideos = arrayOf( - "http://videos.jzvd.org/ldj/01-ldj.mp4", - "http://videos.jzvd.org/ldj/02-ldj.mp4", - "http://videos.jzvd.org/ldj/03-ldj.mp4", - "http://videos.jzvd.org/ldj/04-ldj.mp4", - "http://videos.jzvd.org/ldj/05-ldj.mp4", - "http://videos.jzvd.org/ldj/06-ldj.mp4", - "http://videos.jzvd.org/ldj/07-ldj.mp4", - "http://videos.jzvd.org/ldj/08-ldj.mp4", - "http://videos.jzvd.org/ldj/09-ldj.mp4", - "http://videos.jzvd.org/ldj/10-ldj.mp4", - "http://videos.jzvd.org/ldj/11-ldj.mp4", - "http://videos.jzvd.org/ldj/12-ldj.mp4", - "http://videos.jzvd.org/ldj/13-ldj.mp4", - "http://videos.jzvd.org/ldj/14-ldj.mp4", - "http://videos.jzvd.org/ldj/15-ldj.mp4", - "http://videos.jzvd.org/ldj/16-ldj.mp4", - "http://videos.jzvd.org/ldj/17-ldj.mp4", - "http://videos.jzvd.org/ldj/18-ldj.mp4", - "http://videos.jzvd.org/ldj/19-ldj.mp4", - "http://videos.jzvd.org/ldj/20-ldj.mp4", - "http://videos.jzvd.org/ldj/21-ldj.mp4", - "http://videos.jzvd.org/ldj/22-ldj.mp4", - "http://videos.jzvd.org/ldj/23-ldj.mp4", - "http://videos.jzvd.org/ldj/24-ldj.mp4", - "http://videos.jzvd.org/ldj/25-ldj.mp4", - "http://videos.jzvd.org/ldj/26-ldj.mp4", - "http://videos.jzvd.org/ldj/27-ldj.mp4", - "http://videos.jzvd.org/ldj/28-ldj.mp4", - "http://videos.jzvd.org/ldj/29-ldj.mp4", - "http://videos.jzvd.org/ldj/30-ldj.mp4", - "http://videos.jzvd.org/ldj/31-ldj.mp4", - "http://videos.jzvd.org/ldj/32-ldj.mp4", - "http://videos.jzvd.org/ldj/33-ldj.mp4", - "http://videos.jzvd.org/ldj/34-ldj.mp4", - "http://videos.jzvd.org/ldj/35-ldj.mp4", - "http://videos.jzvd.org/ldj/36-ldj.mp4", - "http://videos.jzvd.org/ldj/37-ldj.mp4", - "http://videos.jzvd.org/ldj/38-ldj.mp4", - "http://videos.jzvd.org/ldj/39-ldj.mp4", - "http://videos.jzvd.org/ldj/40-ldj.mp4", - "http://videos.jzvd.org/ldj/41-ldj.mp4", - "http://videos.jzvd.org/ldj/42-ldj.mp4", - "http://videos.jzvd.org/ldj/43-ldj.mp4", - "http://videos.jzvd.org/ldj/44-ldj.mp4", - "http://videos.jzvd.org/ldj/45-ldj.mp4" + "http://videos.jzvd.org/v/ldj/01-ldj.mp4", + "http://videos.jzvd.org/v/ldj/02-ldj.mp4", + "http://videos.jzvd.org/v/ldj/03-ldj.mp4", + "http://videos.jzvd.org/v/ldj/04-ldj.mp4", + "http://videos.jzvd.org/v/ldj/05-ldj.mp4", + "http://videos.jzvd.org/v/ldj/06-ldj.mp4", + "http://videos.jzvd.org/v/ldj/07-ldj.mp4", + "http://videos.jzvd.org/v/ldj/08-ldj.mp4", + "http://videos.jzvd.org/v/ldj/09-ldj.mp4", + "http://videos.jzvd.org/v/ldj/10-ldj.mp4", + "http://videos.jzvd.org/v/ldj/11-ldj.mp4", + "http://videos.jzvd.org/v/ldj/12-ldj.mp4", + "http://videos.jzvd.org/v/ldj/13-ldj.mp4", + "http://videos.jzvd.org/v/ldj/14-ldj.mp4", + "http://videos.jzvd.org/v/ldj/15-ldj.mp4", + "http://videos.jzvd.org/v/ldj/16-ldj.mp4", + "http://videos.jzvd.org/v/ldj/17-ldj.mp4", + "http://videos.jzvd.org/v/ldj/18-ldj.mp4", + "http://videos.jzvd.org/v/ldj/19-ldj.mp4", + "http://videos.jzvd.org/v/ldj/20-ldj.mp4", + "http://videos.jzvd.org/v/ldj/21-ldj.mp4", + "http://videos.jzvd.org/v/ldj/22-ldj.mp4", + "http://videos.jzvd.org/v/ldj/23-ldj.mp4", + "http://videos.jzvd.org/v/ldj/24-ldj.mp4", + "http://videos.jzvd.org/v/ldj/25-ldj.mp4", + "http://videos.jzvd.org/v/ldj/26-ldj.mp4", + "http://videos.jzvd.org/v/ldj/27-ldj.mp4", + "http://videos.jzvd.org/v/ldj/28-ldj.mp4", + "http://videos.jzvd.org/v/ldj/29-ldj.mp4", + "http://videos.jzvd.org/v/ldj/30-ldj.mp4", + "http://videos.jzvd.org/v/ldj/31-ldj.mp4", + "http://videos.jzvd.org/v/ldj/32-ldj.mp4", + "http://videos.jzvd.org/v/ldj/33-ldj.mp4", + "http://videos.jzvd.org/v/ldj/34-ldj.mp4", + "http://videos.jzvd.org/v/ldj/35-ldj.mp4", + "http://videos.jzvd.org/v/ldj/36-ldj.mp4", + "http://videos.jzvd.org/v/ldj/37-ldj.mp4", + "http://videos.jzvd.org/v/ldj/38-ldj.mp4", + "http://videos.jzvd.org/v/ldj/39-ldj.mp4", + "http://videos.jzvd.org/v/ldj/40-ldj.mp4", + "http://videos.jzvd.org/v/ldj/41-ldj.mp4", + "http://videos.jzvd.org/v/ldj/42-ldj.mp4", + "http://videos.jzvd.org/v/ldj/43-ldj.mp4", + "http://videos.jzvd.org/v/ldj/44-ldj.mp4", + "http://videos.jzvd.org/v/ldj/45-ldj.mp4" ) val videos = arrayOf( From d152763c824e553d2e9b77d29500d3ac71682fc9 Mon Sep 17 00:00:00 2001 From: lipangit <1066666651@qq.com> Date: Sat, 19 Dec 2020 02:17:10 +0800 Subject: [PATCH 03/10] all videos --- build.gradle | 2 +- demo/build.gradle | 3 +- .../java/cn/jzvd/demo/Fragment_1_Base.java | 6 +- .../java/cn/jzvd/demo/Fragment_2_Custom.java | 85 +++++++------------ .../demo/Tab_1_Basic/CustomMediaActivity.java | 22 ++--- .../demo/Tab_1_Basic/OrientationActivity.java | 7 +- .../demo/Tab_1_Basic/PreloadingActivity.java | 17 ++-- .../RotationVideoSizeActivity.java | 7 +- .../Tab_1_Basic/ScreenRotateActivity.java | 7 +- .../Tab_2_Custom/AGVideo/AGVideoActivity.java | 7 +- .../jzvd/demo/Tab_3_List/GetGifActivity.java | 13 +-- .../Tab_3_List/ListView/FragmentDemo.java | 9 +- .../ListView/ListViewMultiHolderActivity.java | 9 +- .../ListView/NormalListViewActivity.java | 9 +- .../ListView/RecyclerViewActivity.java | 22 +++-- .../ListView/adapter/CommentAdapter.java | 12 ++- .../ListView/adapter/RecyclerViewAdapter.java | 13 +-- .../adapter/RecyclerViewLoadMoreAdapter.java | 3 +- .../adapter/RecyclerViewTinyAdapter.java | 9 +- .../adapter/SmoothRecyclerViewAdapter.java | 10 ++- .../tiktok/TikTokRecyclerViewAdapter.java | 9 +- ...yWindowRecycleViewMultiHolderActivity.java | 9 +- .../jzvd/demo/Tab_4_More/DanmuActivity.java | 21 +---- .../demo/Tab_4_More/DirectPlayActivity.java | 5 +- .../jzvd/demo/Tab_4_More/WebViewActivity.java | 19 ++--- demo/src/main/java/cn/jzvd/demo/Urls.java | 35 -------- .../entity => utils}/VideoEntity.java | 2 +- demo/src/main/java/org/jzvd/jzvideo/urls.kt | 28 +++++- library/build.gradle | 2 +- 29 files changed, 183 insertions(+), 219 deletions(-) delete mode 100644 demo/src/main/java/cn/jzvd/demo/Urls.java rename demo/src/main/java/cn/jzvd/demo/{Tab_3_List/ListView/entity => utils}/VideoEntity.java (91%) diff --git a/build.gradle b/build.gradle index 15142398..c991cbcc 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,7 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - ext.kotlin_version = '1.4.20' + ext.kotlin_version = '1.4.21' repositories { jcenter() google() diff --git a/demo/build.gradle b/demo/build.gradle index d174a4c9..ac021865 100644 --- a/demo/build.gradle +++ b/demo/build.gradle @@ -1,8 +1,9 @@ apply plugin: 'com.android.application' +apply plugin: 'kotlin-android' android { compileSdkVersion 30 - buildToolsVersion "30.0.2" + buildToolsVersion "30.0.3" defaultConfig { applicationId "cn.jzvd.demo" diff --git a/demo/src/main/java/cn/jzvd/demo/Fragment_1_Base.java b/demo/src/main/java/cn/jzvd/demo/Fragment_1_Base.java index 6556c5a8..e849af14 100644 --- a/demo/src/main/java/cn/jzvd/demo/Fragment_1_Base.java +++ b/demo/src/main/java/cn/jzvd/demo/Fragment_1_Base.java @@ -14,6 +14,8 @@ import com.bumptech.glide.Glide; +import org.jzvd.jzvideo.UrlsKt; + import java.util.LinkedHashMap; import cn.jzvd.JZDataSource; @@ -68,7 +70,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa public void onActivityCreated(@Nullable Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); LinkedHashMap map = new LinkedHashMap(); - String proxyUrl = ApplicationDemo.getProxy(getContext()).getProxyUrl(Urls.clarities[0]); + String proxyUrl = ApplicationDemo.getProxy(getContext()).getProxyUrl("http://videos.jzvd.org/ldj/01-ldj.mp4"); map.put("高清", proxyUrl); map.put("标清", "http://videos.jzvd.org/ldj/01-ldj.mp4"); map.put("普清", "http://videos.jzvd.org/ldj/04-ldj.mp4"); @@ -79,7 +81,7 @@ public void onActivityCreated(@Nullable Bundle savedInstanceState) { mJzvdStd.setUp(jzDataSource , JzvdStd.SCREEN_NORMAL); Jzvd.PROGRESS_DRAG_RATE = 2f;//设置播放进度条手势滑动阻尼系数 - Glide.with(this).load(Urls.videoPosterList[0]).into(mJzvdStd.posterImageView); + Glide.with(this).load(UrlsKt.getThumbnails()[0]).into(mJzvdStd.posterImageView); } diff --git a/demo/src/main/java/cn/jzvd/demo/Fragment_2_Custom.java b/demo/src/main/java/cn/jzvd/demo/Fragment_2_Custom.java index 24a1adb2..17624e1c 100644 --- a/demo/src/main/java/cn/jzvd/demo/Fragment_2_Custom.java +++ b/demo/src/main/java/cn/jzvd/demo/Fragment_2_Custom.java @@ -12,6 +12,8 @@ import com.bumptech.glide.Glide; +import org.jzvd.jzvideo.UrlsKt; + import cn.jzvd.Jzvd; import cn.jzvd.JzvdStd; import cn.jzvd.demo.CustomJzvd.JzvdStdAutoOrizental; @@ -78,83 +80,56 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa @Override public void onActivityCreated(@Nullable Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); - jzvdStdAutoOrizental.setUp("http://jzvd.nathen.cn/384d341e000145fb82295bdc54ecef88/103eab5afca34baebc970378dd484942-5287d2089db37e62345123a1be272f8b.mp4" - , "饺子大小任意"); - Glide.with(this).load("http://jzvd-pic.nathen.cn/jzvd-pic/1bb2ebbe-140d-4e2e-abd2-9e7e564f71ac.png").into(jzvdStdAutoOrizental.posterImageView); + jzvdStdAutoOrizental.setUp(UrlsKt.getVideos()[0], UrlsKt.getTitles()[0]); + Glide.with(this).load(UrlsKt.getThumbnails()[0]).into(jzvdStdAutoOrizental.posterImageView); - jzvdStdRound.setUp("http://jzvd.nathen.cn/342a5f7ef6124a4a8faf00e738b8bee4/cf6d9db0bd4d41f59d09ea0a81e918fd-5287d2089db37e62345123a1be272f8b.mp4" - , "饺子圆角"); - Glide.with(this).load("http://jzvd-pic.nathen.cn/jzvd-pic/1bb2ebbe-140d-4e2e-abd2-9e7e564f71ac.png").into(jzvdStdRound.posterImageView); + jzvdStdRound.setUp(UrlsKt.getVideos()[1], UrlsKt.getTitles()[1]); + Glide.with(this).load(UrlsKt.getThumbnails()[1]).into(jzvdStdRound.posterImageView); - jzNoTitle.setUp("http://jzvd.nathen.cn/342a5f7ef6124a4a8faf00e738b8bee4/cf6d9db0bd4d41f59d09ea0a81e918fd-5287d2089db37e62345123a1be272f8b.mp4" - , "饺子叫啥也显示不出来啊"); - Glide.with(this).load("http://jzvd-pic.nathen.cn/jzvd-pic/1bb2ebbe-140d-4e2e-abd2-9e7e564f71ac.png").into(jzNoTitle.posterImageView); + jzNoTitle.setUp(UrlsKt.getVideos()[2], UrlsKt.getTitles()[2]); + Glide.with(this).load(UrlsKt.getThumbnails()[2]).into(jzNoTitle.posterImageView); - lockScreen.setUp("http://jzvd.nathen.cn/342a5f7ef6124a4a8faf00e738b8bee4/cf6d9db0bd4d41f59d09ea0a81e918fd-5287d2089db37e62345123a1be272f8b.mp4" - , "饺子定身"); - Glide.with(this).load("http://jzvd-pic.nathen.cn/jzvd-pic/1bb2ebbe-140d-4e2e-abd2-9e7e564f71ac.png").into(lockScreen.posterImageView); + lockScreen.setUp(UrlsKt.getVideos()[3], UrlsKt.getTitles()[3]); + Glide.with(this).load(UrlsKt.getThumbnails()[3]).into(lockScreen.posterImageView); - jzvdStdWithShareButton.setUp(Urls.videoUrlList[3], "饺子想呼吸", Jzvd.SCREEN_NORMAL); - Glide.with(this) - .load(Urls.videoPosterList[3]) - .into(jzvdStdWithShareButton.posterImageView); + jzvdStdWithShareButton.setUp(UrlsKt.getVideos()[4], UrlsKt.getTitles()[4], Jzvd.SCREEN_NORMAL); + Glide.with(this).load(UrlsKt.getThumbnails()[4]).into(jzvdStdWithShareButton.posterImageView); - jzvdStdShowTitleAfterFullscreen.setUp(Urls.videoUrlList[4], "饺子想摇头", Jzvd.SCREEN_NORMAL); - Glide.with(this) - .load(Urls.videoPosterList[4]) - .into(jzvdStdShowTitleAfterFullscreen.posterImageView); + jzvdStdShowTitleAfterFullscreen.setUp(UrlsKt.getVideos()[5], UrlsKt.getTitles()[5], Jzvd.SCREEN_NORMAL); + Glide.with(this).load(UrlsKt.getThumbnails()[5]).into(jzvdStdShowTitleAfterFullscreen.posterImageView); - jzvdStdShowTextureViewAfterAutoComplete.setUp(Urls.videoUrlList[5], "饺子想旅行", Jzvd.SCREEN_NORMAL); - Glide.with(this) - .load(Urls.videoPosterList[5]) - .into(jzvdStdShowTextureViewAfterAutoComplete.posterImageView); + jzvdStdShowTextureViewAfterAutoComplete.setUp(UrlsKt.getVideos()[6], UrlsKt.getTitles()[6], Jzvd.SCREEN_NORMAL); + Glide.with(this).load(UrlsKt.getThumbnails()[6]).into(jzvdStdShowTextureViewAfterAutoComplete.posterImageView); - jzvdStdAutoCompleteAfterFullscreen.setUp(Urls.videoUrls[0][1], "饺子没来", Jzvd.SCREEN_NORMAL); - Glide.with(this) - .load(Urls.videoPosters[0][1]) - .into(jzvdStdAutoCompleteAfterFullscreen.posterImageView); + jzvdStdAutoCompleteAfterFullscreen.setUp(UrlsKt.getVideos()[7], UrlsKt.getTitles()[7], Jzvd.SCREEN_NORMAL); + Glide.with(this).load(UrlsKt.getThumbnails()[7]).into(jzvdStdAutoCompleteAfterFullscreen.posterImageView); - jzvdStd_1_1.setUp(Urls.videoUrls[0][1], "饺子有事吗", Jzvd.SCREEN_NORMAL); - Glide.with(this) - .load(Urls.videoPosters[0][1]) - .into(jzvdStd_1_1.posterImageView); + jzvdStd_1_1.setUp(UrlsKt.getVideos()[8], UrlsKt.getTitles()[8], Jzvd.SCREEN_NORMAL); + Glide.with(this).load(UrlsKt.getThumbnails()[8]).into(jzvdStd_1_1.posterImageView); jzvdStd_1_1.widthRatio = 1; jzvdStd_1_1.heightRatio = 1; - jzvdStd_16_9.setUp(Urls.videoUrls[0][1], "饺子来不了", Jzvd.SCREEN_NORMAL); - Glide.with(this) - .load(Urls.videoPosters[0][1]) - .into(jzvdStd_16_9.posterImageView); + jzvdStd_16_9.setUp(UrlsKt.getVideos()[9], UrlsKt.getTitles()[9], Jzvd.SCREEN_NORMAL); + Glide.with(this).load(UrlsKt.getThumbnails()[9]).into(jzvdStd_16_9.posterImageView); jzvdStd_16_9.widthRatio = 16; jzvdStd_16_9.heightRatio = 9; - jzvdStdVolumeAfterFullscreen.setUp(Urls.videoUrls[0][1], "饺子摇摆", Jzvd.SCREEN_NORMAL); - Glide.with(this) - .load(Urls.videoPosters[0][1]) - .into(jzvdStdVolumeAfterFullscreen.posterImageView); + jzvdStdVolumeAfterFullscreen.setUp(UrlsKt.getVideos()[10], UrlsKt.getTitles()[10], Jzvd.SCREEN_NORMAL); + Glide.with(this).load(UrlsKt.getThumbnails()[10]).into(jzvdStdVolumeAfterFullscreen.posterImageView); - jzvdStdMp3.setUp(Urls.videoUrls[0][1], - "饺子你听", Jzvd.SCREEN_NORMAL); - Glide.with(this) - .load(Urls.videoPosters[0][1]) - .into(jzvdStdMp3.posterImageView); + jzvdStdMp3.setUp(UrlsKt.getVideos()[11], UrlsKt.getTitles()[11], Jzvd.SCREEN_NORMAL); + Glide.with(this).load(UrlsKt.getThumbnails()[11]).into(jzvdStdMp3.posterImageView); - jzvdStdSpeed.setUp(Urls.videoUrls[0][1], - "饺子快点", Jzvd.SCREEN_NORMAL); - Glide.with(this) - .load(Urls.videoPosters[0][1]) - .into(jzvdStdSpeed.posterImageView); + jzvdStdSpeed.setUp(UrlsKt.getVideos()[12], UrlsKt.getTitles()[12], Jzvd.SCREEN_NORMAL); + Glide.with(this).load(UrlsKt.getThumbnails()[12]).into(jzvdStdSpeed.posterImageView); - jzvdStdVolume.setUp(Urls.videoUrls[0][1], - "饺子吃莽莽", Jzvd.SCREEN_NORMAL); - Glide.with(this) - .load(Urls.videoPosters[0][1]) - .into(jzvdStdVolume.posterImageView); + jzvdStdVolume.setUp(UrlsKt.getVideos()[13], UrlsKt.getTitles()[13], Jzvd.SCREEN_NORMAL); + Glide.with(this).load(UrlsKt.getThumbnails()[13]).into(jzvdStdVolume.posterImageView); } @Override diff --git a/demo/src/main/java/cn/jzvd/demo/Tab_1_Basic/CustomMediaActivity.java b/demo/src/main/java/cn/jzvd/demo/Tab_1_Basic/CustomMediaActivity.java index 77b148a7..7777dc74 100644 --- a/demo/src/main/java/cn/jzvd/demo/Tab_1_Basic/CustomMediaActivity.java +++ b/demo/src/main/java/cn/jzvd/demo/Tab_1_Basic/CustomMediaActivity.java @@ -10,6 +10,8 @@ import com.bumptech.glide.Glide; +import org.jzvd.jzvideo.UrlsKt; + import cn.jzvd.JZMediaSystem; import cn.jzvd.Jzvd; import cn.jzvd.JzvdStd; @@ -37,11 +39,11 @@ protected void onCreate(@Nullable Bundle savedInstanceState) { jzvdStd = findViewById(R.id.videoplayer); - jzvdStd.setUp("http://jzvd.nathen.cn/342a5f7ef6124a4a8faf00e738b8bee4/cf6d9db0bd4d41f59d09ea0a81e918fd-5287d2089db37e62345123a1be272f8b.mp4" - , "饺子很保守", JzvdStd.SCREEN_NORMAL); + jzvdStd.setUp(UrlsKt.getVideos()[9] + , UrlsKt.getTitles()[9], JzvdStd.SCREEN_NORMAL); Glide.with(this) - .load("http://jzvd-pic.nathen.cn/jzvd-pic/1bb2ebbe-140d-4e2e-abd2-9e7e564f71ac.png") + .load(UrlsKt.getThumbnails()[9]) .into(jzvdStd.posterImageView); } @@ -49,32 +51,30 @@ protected void onCreate(@Nullable Bundle savedInstanceState) { public void clickChangeToIjkplayer(View view) { Jzvd.releaseAllVideos(); - jzvdStd.setUp("http://jzvd.nathen.cn/342a5f7ef6124a4a8faf00e738b8bee4/cf6d9db0bd4d41f59d09ea0a81e918fd-5287d2089db37e62345123a1be272f8b.mp4" - , "饺子变心", JzvdStd.SCREEN_NORMAL, JZMediaIjk.class); + jzvdStd.setUp(UrlsKt.getVideos()[1] + , UrlsKt.getTitles()[1], JzvdStd.SCREEN_NORMAL, JZMediaIjk.class); jzvdStd.startVideo(); Toast.makeText(this, "Change to Ijkplayer", Toast.LENGTH_SHORT).show(); } public void clickChangeToSystem(View view) { Jzvd.releaseAllVideos(); - jzvdStd.setUp("http://jzvd.nathen.cn/342a5f7ef6124a4a8faf00e738b8bee4/cf6d9db0bd4d41f59d09ea0a81e918fd-5287d2089db37e62345123a1be272f8b.mp4" - , "饺子回来了", JzvdStd.SCREEN_NORMAL, JZMediaSystem.class); + jzvdStd.setUp(UrlsKt.getVideos()[1] + , UrlsKt.getTitles()[1], JzvdStd.SCREEN_NORMAL, JZMediaSystem.class); jzvdStd.startVideo(); Toast.makeText(this, "Change to MediaPlayer", Toast.LENGTH_SHORT).show(); } public void clickChangeToExo(View view) { Jzvd.releaseAllVideos(); - jzvdStd.setUp("http://jzvd.nathen.cn/342a5f7ef6124a4a8faf00e738b8bee4/cf6d9db0bd4d41f59d09ea0a81e918fd-5287d2089db37e62345123a1be272f8b.mp4" - , "饺子追星", JzvdStd.SCREEN_NORMAL, JZMediaExo.class); + jzvdStd.setUp(UrlsKt.getVideos()[1] + , UrlsKt.getTitles()[1], JzvdStd.SCREEN_NORMAL, JZMediaExo.class); jzvdStd.startVideo(); Toast.makeText(this, "Change to ExoPlayer", Toast.LENGTH_SHORT).show(); } public void clickChangeToAliyun(View view) { Jzvd.releaseAllVideos(); -// jzvdStd.setUp("http://jzvd.nathen.cn/342a5f7ef6124a4a8faf00e738b8bee4/cf6d9db0bd4d41f59d09ea0a81e918fd-5287d2089db37e62345123a1be272f8b.mp4" -// , "饺子梭哈", JzvdStd.SCREEN_NORMAL, JZMediaAliyun.class); jzvdStd.setMediaInterface(JZMediaAliyun.class); jzvdStd.startVideo(); Toast.makeText(this, "Change to AliyunPlayer", Toast.LENGTH_SHORT).show(); diff --git a/demo/src/main/java/cn/jzvd/demo/Tab_1_Basic/OrientationActivity.java b/demo/src/main/java/cn/jzvd/demo/Tab_1_Basic/OrientationActivity.java index adf60ff0..9cb76489 100644 --- a/demo/src/main/java/cn/jzvd/demo/Tab_1_Basic/OrientationActivity.java +++ b/demo/src/main/java/cn/jzvd/demo/Tab_1_Basic/OrientationActivity.java @@ -9,10 +9,11 @@ import com.bumptech.glide.Glide; +import org.jzvd.jzvideo.UrlsKt; + import cn.jzvd.Jzvd; import cn.jzvd.JzvdStd; import cn.jzvd.demo.R; -import cn.jzvd.demo.Urls; /** * Created by Nathen on 2016/12/30. @@ -30,10 +31,10 @@ protected void onCreate(@Nullable Bundle savedInstanceState) { getSupportActionBar().setTitle(getString(R.string.orientation)); setContentView(R.layout.activity_orientation); mJzvdStd = findViewById(R.id.jz_video); - mJzvdStd.setUp(Urls.videoUrlList[0], "饺子会旋转" + mJzvdStd.setUp(UrlsKt.getVideos()[25], UrlsKt.getTitles()[25] , JzvdStd.SCREEN_NORMAL); Glide.with(this) - .load(Urls.videoPosterList[0]) + .load(UrlsKt.getThumbnails()[25]) .into(mJzvdStd.posterImageView); } diff --git a/demo/src/main/java/cn/jzvd/demo/Tab_1_Basic/PreloadingActivity.java b/demo/src/main/java/cn/jzvd/demo/Tab_1_Basic/PreloadingActivity.java index ddb9b24b..6365e1cd 100644 --- a/demo/src/main/java/cn/jzvd/demo/Tab_1_Basic/PreloadingActivity.java +++ b/demo/src/main/java/cn/jzvd/demo/Tab_1_Basic/PreloadingActivity.java @@ -8,6 +8,8 @@ import com.bumptech.glide.Glide; +import org.jzvd.jzvideo.UrlsKt; + import cn.jzvd.Jzvd; import cn.jzvd.JzvdStd; import cn.jzvd.demo.CustomMedia.JZMediaIjk; @@ -28,17 +30,10 @@ protected void onCreate(@Nullable Bundle savedInstanceState) { setContentView(R.layout.activity_preloading); jzvdStd = findViewById(R.id.jz_video); -// jzvdStd.setUp("http://jzvd.nathen.cn/342a5f7ef6124a4a8faf00e738b8bee4/cf6d9db0bd4d41f59d09ea0a81e918fd-5287d2089db37e62345123a1be272f8b.mp4" -// , "饺子快长大", Jzvd.SCREEN_NORMAL, JZMediaIjk.class); - jzvdStd.setUp("http://jzvd.nathen.cn/4f965ad507ef4194a60a943a34cfe147/32af151ea132471f92c9ced2cff785ea-5287d2089db37e62345123a1be272f8b.mp4" - , "饺子存钱", Jzvd.SCREEN_NORMAL, JZMediaIjk.class); - - -// jzvdStd.setUp("http://jzvd.nathen.cn/342a5f7ef6124a4a8faf00e738b8bee4/cf6d9db0bd4d41f59d09ea0a81e918fd-5287d2089db37e62345123a1be272f8b.mp4" -// , "饺子快长大"); -// jzvdStd.setUp("http://jzvd.nathen.cn/4f965ad507ef4194a60a943a34cfe147/32af151ea132471f92c9ced2cff785ea-5287d2089db37e62345123a1be272f8b.mp4" -// , "饺子快长大"); - Glide.with(this).load("http://jzvd-pic.nathen.cn/jzvd-pic/1bb2ebbe-140d-4e2e-abd2-9e7e564f71ac.png").into(jzvdStd.posterImageView); + jzvdStd.setUp(UrlsKt.getTitles()[7] + , UrlsKt.getTitles()[7], Jzvd.SCREEN_NORMAL, JZMediaIjk.class); + + Glide.with(this).load(UrlsKt.getTitles()[7]).into(jzvdStd.posterImageView); } diff --git a/demo/src/main/java/cn/jzvd/demo/Tab_1_Basic/RotationVideoSizeActivity.java b/demo/src/main/java/cn/jzvd/demo/Tab_1_Basic/RotationVideoSizeActivity.java index 83715dac..21959946 100644 --- a/demo/src/main/java/cn/jzvd/demo/Tab_1_Basic/RotationVideoSizeActivity.java +++ b/demo/src/main/java/cn/jzvd/demo/Tab_1_Basic/RotationVideoSizeActivity.java @@ -9,10 +9,11 @@ import com.bumptech.glide.Glide; +import org.jzvd.jzvideo.UrlsKt; + import cn.jzvd.Jzvd; import cn.jzvd.JzvdStd; import cn.jzvd.demo.R; -import cn.jzvd.demo.Urls; /** * Created by Nathen on 2017/11/2. @@ -33,10 +34,10 @@ protected void onCreate(@Nullable Bundle savedInstanceState) { setContentView(R.layout.activity_api_rotation_videosize); myJzvdStd = findViewById(R.id.jz_video); - myJzvdStd.setUp(Urls.videoUrls[0][7], Urls.videoTitles[0][7] + myJzvdStd.setUp(UrlsKt.getVideos()[30], UrlsKt.getTitles()[30] , JzvdStd.SCREEN_NORMAL); Glide.with(this) - .load(Urls.videoPosters[0][7]) + .load(UrlsKt.getThumbnails()[30]) .into(myJzvdStd.posterImageView); // The Point IS 或者这样写也可以 // myJzvdStd.videoRotation = 180; diff --git a/demo/src/main/java/cn/jzvd/demo/Tab_1_Basic/ScreenRotateActivity.java b/demo/src/main/java/cn/jzvd/demo/Tab_1_Basic/ScreenRotateActivity.java index b83c304d..ae30b3a0 100644 --- a/demo/src/main/java/cn/jzvd/demo/Tab_1_Basic/ScreenRotateActivity.java +++ b/demo/src/main/java/cn/jzvd/demo/Tab_1_Basic/ScreenRotateActivity.java @@ -8,10 +8,11 @@ import com.bumptech.glide.Glide; +import org.jzvd.jzvideo.UrlsKt; + import cn.jzvd.Jzvd; import cn.jzvd.JzvdStd; import cn.jzvd.demo.R; -import cn.jzvd.demo.Urls; import cn.jzvd.demo.utils.ScreenRotateUtils; /** @@ -30,10 +31,10 @@ protected void onCreate(@Nullable Bundle savedInstanceState) { getSupportActionBar().setTitle(getString(R.string.screen_rotate)); setContentView(R.layout.activity_screen_rotate); mJzvdStd = findViewById(R.id.jz_video); - mJzvdStd.setUp(Urls.videoUrlList[0], "饺子挺好" + mJzvdStd.setUp(UrlsKt.getVideos()[16], UrlsKt.getTitles()[16] , JzvdStd.SCREEN_NORMAL); Glide.with(this) - .load(Urls.videoPosterList[0]) + .load(UrlsKt.getThumbnails()[16]) .into(mJzvdStd.posterImageView); ScreenRotateUtils.getInstance(this.getApplicationContext()).setOrientationChangeListener(this); } diff --git a/demo/src/main/java/cn/jzvd/demo/Tab_2_Custom/AGVideo/AGVideoActivity.java b/demo/src/main/java/cn/jzvd/demo/Tab_2_Custom/AGVideo/AGVideoActivity.java index 99823336..d03ebb57 100644 --- a/demo/src/main/java/cn/jzvd/demo/Tab_2_Custom/AGVideo/AGVideoActivity.java +++ b/demo/src/main/java/cn/jzvd/demo/Tab_2_Custom/AGVideo/AGVideoActivity.java @@ -11,6 +11,8 @@ import com.google.android.material.tabs.TabLayout; +import org.jzvd.jzvideo.UrlsKt; + import java.util.ArrayList; import java.util.List; @@ -21,7 +23,6 @@ import cn.jzvd.demo.Tab_2_Custom.AGVideo.popup.VideoSpeedPopup; import cn.jzvd.demo.CustomMedia.JZMediaExo; import cn.jzvd.demo.R; -import cn.jzvd.demo.Urls; import cn.jzvd.demo.utils.ScreenRotateUtils; public class AGVideoActivity extends AppCompatActivity implements AGVideo.JzVideoListener, ScreenRotateUtils.OrientationChangeListener @@ -314,8 +315,8 @@ public void onEpisodeClickListener(AGEpsodeEntity entity, int position) { private void initVideoData() { episodeList = new ArrayList<>(); - for (int i = 0; i < Urls.ssVideos.length; i++) { - episodeList.add(new AGEpsodeEntity(Urls.ssVideos[i], "三生三世枕上书 第" + (i + 1) + "集")); + for (int i = 0; i < UrlsKt.getLdjVideos().length; i++) { + episodeList.add(new AGEpsodeEntity(UrlsKt.getLdjVideos()[i], "鹿鼎记 第" + (i + 1) + "集")); } } diff --git a/demo/src/main/java/cn/jzvd/demo/Tab_3_List/GetGifActivity.java b/demo/src/main/java/cn/jzvd/demo/Tab_3_List/GetGifActivity.java index 6e8518c5..c21fb794 100644 --- a/demo/src/main/java/cn/jzvd/demo/Tab_3_List/GetGifActivity.java +++ b/demo/src/main/java/cn/jzvd/demo/Tab_3_List/GetGifActivity.java @@ -10,6 +10,8 @@ import com.bumptech.glide.Glide; +import org.jzvd.jzvideo.UrlsKt; + import java.util.LinkedHashMap; import cn.jzvd.JZDataSource; @@ -18,7 +20,6 @@ import cn.jzvd.demo.ApplicationDemo; import cn.jzvd.demo.CustomJzvd.JzvdStdGetGif; import cn.jzvd.demo.R; -import cn.jzvd.demo.Urls; /** * @author dl @@ -50,17 +51,17 @@ protected void onCreate(@Nullable Bundle savedInstanceState) { jzvdStdGetGif = findViewById(R.id.jz_video); LinkedHashMap map = new LinkedHashMap(); - String proxyUrl = ApplicationDemo.getProxy(getBaseContext()).getProxyUrl(Urls.clarities[0]); + String proxyUrl = ApplicationDemo.getProxy(getBaseContext()).getProxyUrl("http://videos.jzvd.org/ldj/01-ldj.mp4"); map.put("高清", proxyUrl); - map.put("标清", Urls.clarities[1]); - map.put("普清", Urls.clarities[2]); - JZDataSource jzDataSource = new JZDataSource(map, "饺子会拼图"); + map.put("标清", "http://videos.jzvd.org/ldj/01-ldj.mp4"); + map.put("普清", "http://videos.jzvd.org/ldj/04-ldj.mp4"); + JZDataSource jzDataSource = new JZDataSource(map, "饺子不信"); jzDataSource.looping = true; jzDataSource.currentUrlIndex = 2; jzDataSource.headerMap.put("key", "value");//header jzvdStdGetGif.setUp(jzDataSource , JzvdStd.SCREEN_NORMAL); - Glide.with(this).load(Urls.videoPosterList[0]).into(jzvdStdGetGif.posterImageView); + Glide.with(this).load(UrlsKt.getThumbnails()[0]).into(jzvdStdGetGif.posterImageView); diff --git a/demo/src/main/java/cn/jzvd/demo/Tab_3_List/ListView/FragmentDemo.java b/demo/src/main/java/cn/jzvd/demo/Tab_3_List/ListView/FragmentDemo.java index debbbb14..e098885c 100644 --- a/demo/src/main/java/cn/jzvd/demo/Tab_3_List/ListView/FragmentDemo.java +++ b/demo/src/main/java/cn/jzvd/demo/Tab_3_List/ListView/FragmentDemo.java @@ -10,10 +10,11 @@ import androidx.fragment.app.Fragment; +import org.jzvd.jzvideo.UrlsKt; + import cn.jzvd.Jzvd; import cn.jzvd.demo.Tab_3_List.ListView.adapter.ListViewAdapter; import cn.jzvd.demo.R; -import cn.jzvd.demo.Urls; /** * Created by Nathen on 2017/6/9. @@ -38,9 +39,9 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInastanceState) { listView = (ListView) inflater.inflate(R.layout.layout_list, container, false); listView.setAdapter(new ListViewAdapter(getActivity(), - Urls.videoUrls[index], - Urls.videoTitles[index], - Urls.videoPosters[index])); + UrlsKt.getVll()[index], + UrlsKt.getTll()[index], + UrlsKt.getPll()[index])); listView.setOnScrollListener(new AbsListView.OnScrollListener() { @Override public void onScrollStateChanged(AbsListView view, int scrollState) { diff --git a/demo/src/main/java/cn/jzvd/demo/Tab_3_List/ListView/ListViewMultiHolderActivity.java b/demo/src/main/java/cn/jzvd/demo/Tab_3_List/ListView/ListViewMultiHolderActivity.java index 576561b1..f6917b71 100644 --- a/demo/src/main/java/cn/jzvd/demo/Tab_3_List/ListView/ListViewMultiHolderActivity.java +++ b/demo/src/main/java/cn/jzvd/demo/Tab_3_List/ListView/ListViewMultiHolderActivity.java @@ -15,10 +15,11 @@ import com.bumptech.glide.Glide; +import org.jzvd.jzvideo.UrlsKt; + import cn.jzvd.Jzvd; import cn.jzvd.JzvdStd; import cn.jzvd.demo.R; -import cn.jzvd.demo.Urls; /** * Created by Nathen @@ -132,11 +133,11 @@ public View getView(int position, View convertView, ViewGroup parent) { } viewHolder.jzvdStd.setUp( - Urls.videoUrls[0][position], - Urls.videoTitles[0][position], Jzvd.SCREEN_NORMAL); + UrlsKt.getVideos()[position], + UrlsKt.getTitles()[position], Jzvd.SCREEN_NORMAL); viewHolder.jzvdStd.positionInList = position; Glide.with(ListViewMultiHolderActivity.this) - .load(Urls.videoPosters[0][position]) + .load(UrlsKt.getThumbnails()[position]) .into(viewHolder.jzvdStd.posterImageView); } else { TextViewHolder textViewHolder; diff --git a/demo/src/main/java/cn/jzvd/demo/Tab_3_List/ListView/NormalListViewActivity.java b/demo/src/main/java/cn/jzvd/demo/Tab_3_List/ListView/NormalListViewActivity.java index b7d620de..52aa05ee 100644 --- a/demo/src/main/java/cn/jzvd/demo/Tab_3_List/ListView/NormalListViewActivity.java +++ b/demo/src/main/java/cn/jzvd/demo/Tab_3_List/ListView/NormalListViewActivity.java @@ -10,10 +10,11 @@ import androidx.annotation.Nullable; import androidx.appcompat.app.AppCompatActivity; +import org.jzvd.jzvideo.UrlsKt; + import cn.jzvd.Jzvd; import cn.jzvd.demo.Tab_3_List.ListView.adapter.ListViewAdapter; import cn.jzvd.demo.R; -import cn.jzvd.demo.Urls; /** * Created by Nathen on 16/7/31. @@ -36,9 +37,9 @@ protected void onCreate(@Nullable Bundle savedInstanceState) { listView = findViewById(R.id.listview); listView.setAdapter(new ListViewAdapter(this, - Urls.videoUrls[0], - Urls.videoTitles[0], - Urls.videoPosters[0])); + UrlsKt.getVl3(), + UrlsKt.getTl3(), + UrlsKt.getPl3())); listView.setOnScrollListener(new AbsListView.OnScrollListener() { @Override diff --git a/demo/src/main/java/cn/jzvd/demo/Tab_3_List/ListView/RecyclerViewActivity.java b/demo/src/main/java/cn/jzvd/demo/Tab_3_List/ListView/RecyclerViewActivity.java index 182cbb1c..d9d7198b 100644 --- a/demo/src/main/java/cn/jzvd/demo/Tab_3_List/ListView/RecyclerViewActivity.java +++ b/demo/src/main/java/cn/jzvd/demo/Tab_3_List/ListView/RecyclerViewActivity.java @@ -3,22 +3,27 @@ import android.os.Bundle; import android.view.MenuItem; import android.view.View; + import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.appcompat.app.AppCompatActivity; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; + import com.scwang.smart.refresh.layout.SmartRefreshLayout; import com.scwang.smart.refresh.layout.api.RefreshLayout; import com.scwang.smart.refresh.layout.listener.OnLoadMoreListener; import com.scwang.smart.refresh.layout.listener.OnRefreshListener; + +import org.jzvd.jzvideo.UrlsKt; + import java.util.ArrayList; import java.util.Collections; + import cn.jzvd.Jzvd; import cn.jzvd.demo.Tab_3_List.ListView.adapter.RecyclerViewLoadMoreAdapter; import cn.jzvd.demo.R; -import cn.jzvd.demo.Tab_3_List.ListView.entity.VideoEntity; -import cn.jzvd.demo.Urls; +import cn.jzvd.demo.utils.VideoEntity; /** * Created by yujunkui on 16/8/29. @@ -28,6 +33,7 @@ public class RecyclerViewActivity extends AppCompatActivity { RecyclerViewLoadMoreAdapter adapterVideoList; SmartRefreshLayout refreshLayout; ArrayList videos; + @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -82,7 +88,7 @@ public void onScrollStateChanged(@NonNull RecyclerView recyclerView, int newStat LinearLayoutManager linearLayoutManager = (LinearLayoutManager) recyclerView.getLayoutManager(); int lastPositon = linearLayoutManager.findLastVisibleItemPosition(); int count = recyclerView.getAdapter().getItemCount(); - if(newState == RecyclerView.SCROLL_STATE_IDLE && count > 3 && lastPositon >= count - 3){ + if (newState == RecyclerView.SCROLL_STATE_IDLE && count > 3 && lastPositon >= count - 3) { loadMore(); } } @@ -103,17 +109,17 @@ private void initData() { videos = new ArrayList<>(); addData(); recyclerView.setLayoutManager(new LinearLayoutManager(this)); - adapterVideoList = new RecyclerViewLoadMoreAdapter(this,videos); + adapterVideoList = new RecyclerViewLoadMoreAdapter(this, videos); recyclerView.setAdapter(adapterVideoList); } private void addData() { ArrayList tempList = new ArrayList<>(); - for (int i = 0; i < Urls.videoUrls[0].length; i++) { + for (int i = 0; i < UrlsKt.getVl2().length; i++) { VideoEntity videoEntity = new VideoEntity(); - videoEntity.setUrl(Urls.videoUrls[0][i]); - videoEntity.setTitle(Urls.videoTitles[0][i]); - videoEntity.setThumb(Urls.videoPosters[0][i]); + videoEntity.setUrl(UrlsKt.getVl2()[i]); + videoEntity.setTitle(UrlsKt.getTl2()[i]); + videoEntity.setThumb(UrlsKt.getPl2()[i]); tempList.add(videoEntity); } //随机打乱 diff --git a/demo/src/main/java/cn/jzvd/demo/Tab_3_List/ListView/adapter/CommentAdapter.java b/demo/src/main/java/cn/jzvd/demo/Tab_3_List/ListView/adapter/CommentAdapter.java index 2289f040..e0e437a4 100644 --- a/demo/src/main/java/cn/jzvd/demo/Tab_3_List/ListView/adapter/CommentAdapter.java +++ b/demo/src/main/java/cn/jzvd/demo/Tab_3_List/ListView/adapter/CommentAdapter.java @@ -11,8 +11,9 @@ import com.bumptech.glide.Glide; +import org.jzvd.jzvideo.UrlsKt; + import cn.jzvd.demo.R; -import cn.jzvd.demo.Urls; public class CommentAdapter extends RecyclerView.Adapter { @@ -27,10 +28,13 @@ public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { @Override public void onBindViewHolder(ViewHolder holder, int position) { - Glide.with(holder.ivHead.getContext()).load(Urls.videoPosters[0][position]) + Glide.with(holder.ivHead.getContext()).load( + UrlsKt.getPl1()[position]) .into(holder.ivHead); - holder.tvName.setText(Urls.videoTitles[0][position]); - holder.tvContent.setText(Urls.videoTitles[0][position]); + holder.tvName.setText( + UrlsKt.getTl1()[position]); + holder.tvContent.setText( + UrlsKt.getVl1()[position]); } @Override diff --git a/demo/src/main/java/cn/jzvd/demo/Tab_3_List/ListView/adapter/RecyclerViewAdapter.java b/demo/src/main/java/cn/jzvd/demo/Tab_3_List/ListView/adapter/RecyclerViewAdapter.java index 06563580..22a8bdf4 100644 --- a/demo/src/main/java/cn/jzvd/demo/Tab_3_List/ListView/adapter/RecyclerViewAdapter.java +++ b/demo/src/main/java/cn/jzvd/demo/Tab_3_List/ListView/adapter/RecyclerViewAdapter.java @@ -11,13 +11,11 @@ import com.bumptech.glide.Glide; -import java.util.ArrayList; +import org.jzvd.jzvideo.UrlsKt; import cn.jzvd.Jzvd; import cn.jzvd.JzvdStd; import cn.jzvd.demo.R; -import cn.jzvd.demo.Tab_3_List.ListView.entity.VideoEntity; -import cn.jzvd.demo.Urls; public class RecyclerViewAdapter extends RecyclerView.Adapter { @@ -43,9 +41,12 @@ public void onBindViewHolder(MyViewHolder holder, int position) { Log.i(TAG, "onBindViewHolder [" + holder.jzvdStd.hashCode() + "] position=" + position); holder.jzvdStd.setUp( - Urls.videoUrls[0][position], - Urls.videoTitles[0][position], Jzvd.SCREEN_NORMAL); - Glide.with(holder.jzvdStd.getContext()).load(Urls.videoPosters[0][position]).into(holder.jzvdStd.posterImageView); + + UrlsKt.getVl1()[position], + + UrlsKt.getTl1()[position], Jzvd.SCREEN_NORMAL); + Glide.with(holder.jzvdStd.getContext()).load( + UrlsKt.getPl1()[position]).into(holder.jzvdStd.posterImageView); } @Override diff --git a/demo/src/main/java/cn/jzvd/demo/Tab_3_List/ListView/adapter/RecyclerViewLoadMoreAdapter.java b/demo/src/main/java/cn/jzvd/demo/Tab_3_List/ListView/adapter/RecyclerViewLoadMoreAdapter.java index aef4d402..0a4f23c9 100644 --- a/demo/src/main/java/cn/jzvd/demo/Tab_3_List/ListView/adapter/RecyclerViewLoadMoreAdapter.java +++ b/demo/src/main/java/cn/jzvd/demo/Tab_3_List/ListView/adapter/RecyclerViewLoadMoreAdapter.java @@ -16,8 +16,7 @@ import cn.jzvd.Jzvd; import cn.jzvd.JzvdStd; import cn.jzvd.demo.R; -import cn.jzvd.demo.Tab_3_List.ListView.entity.VideoEntity; -import cn.jzvd.demo.Urls; +import cn.jzvd.demo.utils.VideoEntity; public class RecyclerViewLoadMoreAdapter extends RecyclerView.Adapter { diff --git a/demo/src/main/java/cn/jzvd/demo/Tab_3_List/ListView/adapter/RecyclerViewTinyAdapter.java b/demo/src/main/java/cn/jzvd/demo/Tab_3_List/ListView/adapter/RecyclerViewTinyAdapter.java index 01a9be41..1981ee6d 100644 --- a/demo/src/main/java/cn/jzvd/demo/Tab_3_List/ListView/adapter/RecyclerViewTinyAdapter.java +++ b/demo/src/main/java/cn/jzvd/demo/Tab_3_List/ListView/adapter/RecyclerViewTinyAdapter.java @@ -11,10 +11,11 @@ import com.bumptech.glide.Glide; +import org.jzvd.jzvideo.UrlsKt; + import cn.jzvd.Jzvd; import cn.jzvd.demo.CustomJzvd.JzvdStdTinyWindow; import cn.jzvd.demo.R; -import cn.jzvd.demo.Urls; public class RecyclerViewTinyAdapter extends RecyclerView.Adapter { @@ -41,9 +42,9 @@ public void onBindViewHolder(MyViewHolder holder, int position) { if (holder.jzvdStd.getTag() != null) holder.jzvdStd = ((View) holder.jzvdStd.getTag()).findViewById(R.id.videoplayer); holder.jzvdStd.setUp( - Urls.videoUrls[0][position], - Urls.videoTitles[0][position], Jzvd.SCREEN_NORMAL); - Glide.with(holder.jzvdStd.getContext()).load(Urls.videoPosters[0][position]).into(holder.jzvdStd.posterImageView); + UrlsKt.getVl1()[position], + UrlsKt.getVl1()[position], Jzvd.SCREEN_NORMAL); + Glide.with(holder.jzvdStd.getContext()).load(UrlsKt.getVl1()[position]).into(holder.jzvdStd.posterImageView); } @Override diff --git a/demo/src/main/java/cn/jzvd/demo/Tab_3_List/ListView/adapter/SmoothRecyclerViewAdapter.java b/demo/src/main/java/cn/jzvd/demo/Tab_3_List/ListView/adapter/SmoothRecyclerViewAdapter.java index f4184b73..066cf473 100644 --- a/demo/src/main/java/cn/jzvd/demo/Tab_3_List/ListView/adapter/SmoothRecyclerViewAdapter.java +++ b/demo/src/main/java/cn/jzvd/demo/Tab_3_List/ListView/adapter/SmoothRecyclerViewAdapter.java @@ -11,10 +11,11 @@ import com.bumptech.glide.Glide; +import org.jzvd.jzvideo.UrlsKt; + import cn.jzvd.Jzvd; import cn.jzvd.demo.CustomJzvd.JzvdStdRv; import cn.jzvd.demo.R; -import cn.jzvd.demo.Urls; import cn.jzvd.demo.utils.AutoPlayUtils; import cn.jzvd.demo.utils.ViewAttr; @@ -64,9 +65,10 @@ public void onBindViewHolder(MyViewHolder holder, int position) { jzvdStdRv = (JzvdStdRv) holder.container.getChildAt(0); } jzvdStdRv.setUp( - Urls.videoUrls[0][position], - Urls.videoTitles[0][position], Jzvd.SCREEN_NORMAL); - Glide.with(holder.container.getContext()).load(Urls.videoPosters[0][position]) + UrlsKt.getVl1()[position], + UrlsKt.getTl1()[position], Jzvd.SCREEN_NORMAL); + Glide.with(holder.container.getContext()).load( + UrlsKt.getPl1()[position]) .into(jzvdStdRv.posterImageView); } jzvdStdRv.setId(R.id.jzvdplayer); diff --git a/demo/src/main/java/cn/jzvd/demo/Tab_3_List/ListView/tiktok/TikTokRecyclerViewAdapter.java b/demo/src/main/java/cn/jzvd/demo/Tab_3_List/ListView/tiktok/TikTokRecyclerViewAdapter.java index e6c245c9..f1ae9713 100644 --- a/demo/src/main/java/cn/jzvd/demo/Tab_3_List/ListView/tiktok/TikTokRecyclerViewAdapter.java +++ b/demo/src/main/java/cn/jzvd/demo/Tab_3_List/ListView/tiktok/TikTokRecyclerViewAdapter.java @@ -11,11 +11,12 @@ import com.bumptech.glide.Glide; +import org.jzvd.jzvideo.UrlsKt; + import cn.jzvd.JZDataSource; import cn.jzvd.Jzvd; import cn.jzvd.demo.CustomJzvd.JzvdStdTikTok; import cn.jzvd.demo.R; -import cn.jzvd.demo.Urls; public class TikTokRecyclerViewAdapter extends RecyclerView.Adapter { @@ -40,11 +41,11 @@ public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { public void onBindViewHolder(MyViewHolder holder, int position) { Log.i(TAG, "onBindViewHolder [" + holder.jzvdStd.hashCode() + "] position=" + position); - JZDataSource jzDataSource = new JZDataSource(Urls.videoUrls[3][position], - Urls.videoTitles[0][position]); + JZDataSource jzDataSource = new JZDataSource(UrlsKt.getVl1()[position], + UrlsKt.getTl1()[position]); jzDataSource.looping = true; holder.jzvdStd.setUp(jzDataSource, Jzvd.SCREEN_NORMAL); - Glide.with(holder.jzvdStd.getContext()).load(Urls.videoPosters[0][position]).into(holder.jzvdStd.posterImageView); + Glide.with(holder.jzvdStd.getContext()).load(UrlsKt.getPl1()[position]).into(holder.jzvdStd.posterImageView); } @Override diff --git a/demo/src/main/java/cn/jzvd/demo/Tab_3_List/TinyWindow/TinyWindowRecycleViewMultiHolderActivity.java b/demo/src/main/java/cn/jzvd/demo/Tab_3_List/TinyWindow/TinyWindowRecycleViewMultiHolderActivity.java index e2882091..43fd7a69 100644 --- a/demo/src/main/java/cn/jzvd/demo/Tab_3_List/TinyWindow/TinyWindowRecycleViewMultiHolderActivity.java +++ b/demo/src/main/java/cn/jzvd/demo/Tab_3_List/TinyWindow/TinyWindowRecycleViewMultiHolderActivity.java @@ -15,11 +15,12 @@ import com.bumptech.glide.Glide; +import org.jzvd.jzvideo.UrlsKt; + import cn.jzvd.Jzvd; import cn.jzvd.JzvdStd; import cn.jzvd.demo.CustomJzvd.JzvdStdTinyWindow; import cn.jzvd.demo.R; -import cn.jzvd.demo.Urls; /** * Created by Nathen on 2017/11/1. @@ -132,11 +133,9 @@ public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) { TextHolder textHolder = (TextHolder) holder; } else { VideoHolder videoHolder = (VideoHolder) holder; - videoHolder.jzvdStd.setUp( - Urls.videoUrls[0][position], - Urls.videoTitles[0][position], Jzvd.SCREEN_NORMAL); + videoHolder.jzvdStd.setUp(UrlsKt.getVl1()[position], UrlsKt.getTl1()[position], Jzvd.SCREEN_NORMAL); videoHolder.jzvdStd.positionInList = position; - Glide.with(TinyWindowRecycleViewMultiHolderActivity.this).load(Urls.videoPosters[0][position]).into(videoHolder.jzvdStd.posterImageView); + Glide.with(TinyWindowRecycleViewMultiHolderActivity.this).load(UrlsKt.getPl1()[position]).into(videoHolder.jzvdStd.posterImageView); } } diff --git a/demo/src/main/java/cn/jzvd/demo/Tab_4_More/DanmuActivity.java b/demo/src/main/java/cn/jzvd/demo/Tab_4_More/DanmuActivity.java index cacb1dd2..a3ea025f 100644 --- a/demo/src/main/java/cn/jzvd/demo/Tab_4_More/DanmuActivity.java +++ b/demo/src/main/java/cn/jzvd/demo/Tab_4_More/DanmuActivity.java @@ -1,37 +1,22 @@ package cn.jzvd.demo.Tab_4_More; -import android.content.pm.PackageManager; import android.os.Bundle; -import android.os.Environment; import android.os.Handler; import android.view.MenuItem; import android.view.View; import android.widget.Button; -import android.widget.Toast; -import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.appcompat.app.AppCompatActivity; -import androidx.core.app.ActivityCompat; import com.bumptech.glide.Glide; -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.util.Random; +import org.jzvd.jzvideo.UrlsKt; import cn.jzvd.JZUtils; import cn.jzvd.Jzvd; -import cn.jzvd.JzvdStd; import cn.jzvd.demo.CustomJzvd.JzvdDanmu; -import cn.jzvd.demo.CustomJzvd.JzvdStdAssert; -import cn.jzvd.demo.CustomMedia.JZMediaSystemAssertFolder; import cn.jzvd.demo.R; -import cn.jzvd.demo.Urls; -import master.flame.danmaku.ui.widget.DanmakuView; /** * @author Liberations @@ -63,8 +48,8 @@ protected void onCreate(@Nullable Bundle savedInstanceState) { hideDanmu.setOnClickListener(this); - jzvdDanmu.setUp(Urls.clarities[2], "饺子键盘侠", Jzvd.SCREEN_NORMAL); - Glide.with(this).load(Urls.videoPosterList[0]).into(jzvdDanmu.posterImageView); + jzvdDanmu.setUp(UrlsKt.getVideos()[14], UrlsKt.getTitles()[14], Jzvd.SCREEN_NORMAL); + Glide.with(this).load(UrlsKt.getThumbnails()[14]).into(jzvdDanmu.posterImageView); testDanmu(); jzvdDanmu.startButton.performClick(); diff --git a/demo/src/main/java/cn/jzvd/demo/Tab_4_More/DirectPlayActivity.java b/demo/src/main/java/cn/jzvd/demo/Tab_4_More/DirectPlayActivity.java index 2ebb9140..f0bbdb77 100644 --- a/demo/src/main/java/cn/jzvd/demo/Tab_4_More/DirectPlayActivity.java +++ b/demo/src/main/java/cn/jzvd/demo/Tab_4_More/DirectPlayActivity.java @@ -8,10 +8,11 @@ import androidx.annotation.Nullable; import androidx.appcompat.app.AppCompatActivity; +import org.jzvd.jzvideo.UrlsKt; + import cn.jzvd.Jzvd; import cn.jzvd.JzvdStd; import cn.jzvd.demo.R; -import cn.jzvd.demo.Urls; /** * Created by Nathen on 16/7/31. @@ -54,7 +55,7 @@ public boolean onOptionsItemSelected(MenuItem item) { } public void clickFullScreen(View view) { - JzvdStd.startFullscreenDirectly(this, JzvdStd.class, Urls.videoUrlList[6], "饺子辛苦了"); + JzvdStd.startFullscreenDirectly(this, JzvdStd.class, UrlsKt.getVideos()[15], UrlsKt.getTitles()[15]); } public void clickTinyWindow(View view) { diff --git a/demo/src/main/java/cn/jzvd/demo/Tab_4_More/WebViewActivity.java b/demo/src/main/java/cn/jzvd/demo/Tab_4_More/WebViewActivity.java index 30fb298d..50100d1d 100644 --- a/demo/src/main/java/cn/jzvd/demo/Tab_4_More/WebViewActivity.java +++ b/demo/src/main/java/cn/jzvd/demo/Tab_4_More/WebViewActivity.java @@ -13,11 +13,12 @@ import com.bumptech.glide.Glide; +import org.jzvd.jzvideo.UrlsKt; + import cn.jzvd.JZUtils; import cn.jzvd.Jzvd; import cn.jzvd.JzvdStd; import cn.jzvd.demo.R; -import cn.jzvd.demo.Urls; /** * Created by Nathen on 16/10/13. @@ -73,11 +74,9 @@ public void adViewJiaoZiVideoPlayer(final int width, final int height, final int runOnUiThread(() -> { if (index == 0) { JzvdStd jzvdStd = new JzvdStd(WebViewActivity.this); - jzvdStd.setUp(Urls.videoUrlList[1], "饺子骑大马", - Jzvd.SCREEN_NORMAL); - Glide.with(WebViewActivity.this) - .load(Urls.videoPosterList[1]) - .into(jzvdStd.posterImageView); + jzvdStd.setUp(UrlsKt.getVideos()[16], UrlsKt.getTitles()[16], Jzvd.SCREEN_NORMAL); + Glide.with(WebViewActivity.this).load(UrlsKt.getThumbnails()[16]).into(jzvdStd.posterImageView); + ViewGroup.LayoutParams ll = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); AbsoluteLayout.LayoutParams layoutParams = new AbsoluteLayout.LayoutParams(ll); layoutParams.y = JZUtils.dip2px(WebViewActivity.this, top); @@ -90,11 +89,9 @@ public void adViewJiaoZiVideoPlayer(final int width, final int height, final int mWebView.addView(linearLayout, layoutParams); } else { JzvdStd jzvdStd = new JzvdStd(WebViewActivity.this); - jzvdStd.setUp(Urls.videoUrlList[2], "饺子失态了", - Jzvd.SCREEN_NORMAL); - Glide.with(WebViewActivity.this) - .load(Urls.videoPosterList[2]) - .into(jzvdStd.posterImageView); + jzvdStd.setUp(UrlsKt.getVideos()[16], UrlsKt.getTitles()[16], Jzvd.SCREEN_NORMAL); + Glide.with(WebViewActivity.this).load(UrlsKt.getThumbnails()[16]).into(jzvdStd.posterImageView); + ViewGroup.LayoutParams ll = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); AbsoluteLayout.LayoutParams layoutParams = new AbsoluteLayout.LayoutParams(ll); layoutParams.y = JZUtils.dip2px(WebViewActivity.this, top); diff --git a/demo/src/main/java/cn/jzvd/demo/Urls.java b/demo/src/main/java/cn/jzvd/demo/Urls.java deleted file mode 100644 index dfbfedfd..00000000 --- a/demo/src/main/java/cn/jzvd/demo/Urls.java +++ /dev/null @@ -1,35 +0,0 @@ -package cn.jzvd.demo; - -/** - * Created by shengjun on 16/9/10. - */ -public class Urls { - public static String[] clarities = { - "https://jzvd.nathen.cn/video/460bad24-170c5bc6956-0007-1823-c86-de200.mp4", - "https://jzvd.nathen.cn/video/2b64c629-17204eaa4fa-0007-1823-c86-de200.mp4", - "https://jzvd.nathen.cn/video/a70a7fb-17204eaa501-0007-1823-c86-de200.mp4" - }; - public static String[] videoUrlList = { - "http://jzvd.nathen.cn/c494b340ff704015bb6682ffde3cd302/64929c369124497593205a4190d7d128-5287d2089db37e62345123a1be272f8b.mp4", - "http://jzvd.nathen.cn/63f3f73712544394be981d9e4f56b612/69c5767bb9e54156b5b60a1b6edeb3b5-5287d2089db37e62345123a1be272f8b.mp4", - "http://jzvd.nathen.cn/b201be3093814908bf987320361c5a73/2f6d913ea25941ffa78cc53a59025383-5287d2089db37e62345123a1be272f8b.mp4", - "http://jzvd.nathen.cn/d2438fd1c37c4618a704513ad38d68c5/68626a9d53ca421c896ac8010f172b68-5287d2089db37e62345123a1be272f8b.mp4", - "http://jzvd.nathen.cn/25a8d119cfa94b49a7a4117257d8ebd7/f733e65a22394abeab963908f3c336db-5287d2089db37e62345123a1be272f8b.mp4", - "http://jzvd.nathen.cn/7512edd1ad834d40bb5b978402274b1a/9691c7f2d7b74b5e811965350a0e5772-5287d2089db37e62345123a1be272f8b.mp4", - "http://jzvd.nathen.cn/c6e3dc12a1154626b3476d9bf3bd7266/6b56c5f0dc31428083757a45764763b0-5287d2089db37e62345123a1be272f8b.mp4" - }; - - - public static String[] videoPosterList = { - "http://jzvd-pic.nathen.cn/jzvd-pic/00b026e7-b830-4994-bc87-38f4033806a6.jpg", - "http://jzvd-pic.nathen.cn/jzvd-pic/1d935cc5-a1e7-4779-bdfa-20fd7a60724c.jpg", - "http://jzvd-pic.nathen.cn/jzvd-pic/a019ffc1-556c-4a85-b70c-b1b49811d577.jpg", - "http://jzvd-pic.nathen.cn/jzvd-pic/6fc2ae91-36e2-44c5-bb10-29ae5d5c678c.png", - "http://jzvd-pic.nathen.cn/jzvd-pic/f03cee95-9b78-4dd5-986f-d162c06c385c.png", - "http://jzvd-pic.nathen.cn/jzvd-pic/e7ea659f-c3d2-4979-9ea5-f993b05e5930.png", - "" - - }; - - -} diff --git a/demo/src/main/java/cn/jzvd/demo/Tab_3_List/ListView/entity/VideoEntity.java b/demo/src/main/java/cn/jzvd/demo/utils/VideoEntity.java similarity index 91% rename from demo/src/main/java/cn/jzvd/demo/Tab_3_List/ListView/entity/VideoEntity.java rename to demo/src/main/java/cn/jzvd/demo/utils/VideoEntity.java index 28fd3f20..1f45abd9 100644 --- a/demo/src/main/java/cn/jzvd/demo/Tab_3_List/ListView/entity/VideoEntity.java +++ b/demo/src/main/java/cn/jzvd/demo/utils/VideoEntity.java @@ -1,4 +1,4 @@ -package cn.jzvd.demo.Tab_3_List.ListView.entity; +package cn.jzvd.demo.utils; public class VideoEntity { private String url; diff --git a/demo/src/main/java/org/jzvd/jzvideo/urls.kt b/demo/src/main/java/org/jzvd/jzvideo/urls.kt index ee5d4aea..8cac6f64 100644 --- a/demo/src/main/java/org/jzvd/jzvideo/urls.kt +++ b/demo/src/main/java/org/jzvd/jzvideo/urls.kt @@ -1,5 +1,7 @@ package org.jzvd.jzvideo +// Chrome浏览器和饺子demo(android.MediaPlayer)相同时间相同网络环境播放,速度相差很远,为什么。 +// ijk好像略快,但没有电脑的chrome快。红米手机的自带浏览器可以完整观看视频无需中途加载。 val ldjVideos = arrayOf( "http://videos.jzvd.org/v/ldj/01-ldj.mp4", @@ -139,10 +141,30 @@ val titles = arrayOf( "饺子不服" ) -val list1 = videos.copyOfRange(3, 9) -val list2 = videos.copyOfRange(1, 6) -val list3 = videos.copyOfRange(0, 3) +val vl1 = videos.copyOfRange(3, 9) +val pl1 = videos.copyOfRange(3, 9) +val tl1 = videos.copyOfRange(3, 9) +val vl2 = videos.copyOfRange(10, 20) +val pl2 = videos.copyOfRange(10, 20) +val tl2 = videos.copyOfRange(10, 20) + +val vl3 = videos.copyOfRange(20, 21) +val pl3 = videos.copyOfRange(20, 21) +val tl3 = videos.copyOfRange(20, 21) + + +val vll = arrayOf( + vl1, vl2, vl3 +) + +val pll = arrayOf( + pl1, pl2, pl3 +) + +val tll = arrayOf( + tl1, tl2, tl3 +) diff --git a/library/build.gradle b/library/build.gradle index 602bf142..ffc31e51 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -3,7 +3,7 @@ apply plugin: 'kotlin-android' android { compileSdkVersion 30 - buildToolsVersion = '30.0.2' + buildToolsVersion = '30.0.3' defaultConfig { minSdkVersion 16 From 2a7dd4321161e2b1711e13e8b670bf8f29c359ac Mon Sep 17 00:00:00 2001 From: lipangit <1066666651@qq.com> Date: Sat, 19 Dec 2020 02:21:40 +0800 Subject: [PATCH 04/10] urls --- demo/src/main/java/cn/jzvd/demo/Fragment_1_Base.java | 6 +++--- .../main/java/cn/jzvd/demo/Tab_3_List/GetGifActivity.java | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/demo/src/main/java/cn/jzvd/demo/Fragment_1_Base.java b/demo/src/main/java/cn/jzvd/demo/Fragment_1_Base.java index e849af14..6c6c758f 100644 --- a/demo/src/main/java/cn/jzvd/demo/Fragment_1_Base.java +++ b/demo/src/main/java/cn/jzvd/demo/Fragment_1_Base.java @@ -70,10 +70,10 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa public void onActivityCreated(@Nullable Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); LinkedHashMap map = new LinkedHashMap(); - String proxyUrl = ApplicationDemo.getProxy(getContext()).getProxyUrl("http://videos.jzvd.org/ldj/01-ldj.mp4"); + String proxyUrl = ApplicationDemo.getProxy(getContext()).getProxyUrl("http://videos.jzvd.org/v/ldj/01-ldj.mp4"); map.put("高清", proxyUrl); - map.put("标清", "http://videos.jzvd.org/ldj/01-ldj.mp4"); - map.put("普清", "http://videos.jzvd.org/ldj/04-ldj.mp4"); + map.put("标清", "http://videos.jzvd.org/v/ldj/01-ldj.mp4"); + map.put("普清", "http://videos.jzvd.org/v/ldj/04-ldj.mp4"); JZDataSource jzDataSource = new JZDataSource(map, "饺子不信"); jzDataSource.looping = true; jzDataSource.currentUrlIndex = 2; diff --git a/demo/src/main/java/cn/jzvd/demo/Tab_3_List/GetGifActivity.java b/demo/src/main/java/cn/jzvd/demo/Tab_3_List/GetGifActivity.java index c21fb794..c409d363 100644 --- a/demo/src/main/java/cn/jzvd/demo/Tab_3_List/GetGifActivity.java +++ b/demo/src/main/java/cn/jzvd/demo/Tab_3_List/GetGifActivity.java @@ -51,10 +51,10 @@ protected void onCreate(@Nullable Bundle savedInstanceState) { jzvdStdGetGif = findViewById(R.id.jz_video); LinkedHashMap map = new LinkedHashMap(); - String proxyUrl = ApplicationDemo.getProxy(getBaseContext()).getProxyUrl("http://videos.jzvd.org/ldj/01-ldj.mp4"); + String proxyUrl = ApplicationDemo.getProxy(getBaseContext()).getProxyUrl("http://videos.jzvd.org/v/ldj/01-ldj.mp4"); map.put("高清", proxyUrl); - map.put("标清", "http://videos.jzvd.org/ldj/01-ldj.mp4"); - map.put("普清", "http://videos.jzvd.org/ldj/04-ldj.mp4"); + map.put("标清", "http://videos.jzvd.org/v/ldj/01-ldj.mp4"); + map.put("普清", "http://videos.jzvd.org/v/ldj/04-ldj.mp4"); JZDataSource jzDataSource = new JZDataSource(map, "饺子不信"); jzDataSource.looping = true; jzDataSource.currentUrlIndex = 2; From 4dbcd8b917dd99593a97adc2d516153c6e5a04b3 Mon Sep 17 00:00:00 2001 From: lipangit <1066666651@qq.com> Date: Sat, 19 Dec 2020 23:05:37 +0800 Subject: [PATCH 05/10] ali urls --- .../java/cn/jzvd/demo/Fragment_1_Base.java | 10 ++--- .../jzvd/demo/Tab_3_List/GetGifActivity.java | 8 +--- .../TinyWindow/TinyWindowActivity.java | 7 +++- demo/src/main/java/org/jzvd/jzvideo/urls.kt | 39 +++++++++++++++---- 4 files changed, 43 insertions(+), 21 deletions(-) diff --git a/demo/src/main/java/cn/jzvd/demo/Fragment_1_Base.java b/demo/src/main/java/cn/jzvd/demo/Fragment_1_Base.java index 6c6c758f..381ee3c9 100644 --- a/demo/src/main/java/cn/jzvd/demo/Fragment_1_Base.java +++ b/demo/src/main/java/cn/jzvd/demo/Fragment_1_Base.java @@ -70,18 +70,18 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa public void onActivityCreated(@Nullable Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); LinkedHashMap map = new LinkedHashMap(); - String proxyUrl = ApplicationDemo.getProxy(getContext()).getProxyUrl("http://videos.jzvd.org/v/ldj/01-ldj.mp4"); + String proxyUrl = ApplicationDemo.getProxy(getContext()).getProxyUrl(UrlsKt.getAliVideos()[0]); map.put("高清", proxyUrl); - map.put("标清", "http://videos.jzvd.org/v/ldj/01-ldj.mp4"); - map.put("普清", "http://videos.jzvd.org/v/ldj/04-ldj.mp4"); - JZDataSource jzDataSource = new JZDataSource(map, "饺子不信"); + map.put("标清", UrlsKt.getAliVideos()[1]); + map.put("普清", UrlsKt.getAliVideos()[2]); + JZDataSource jzDataSource = new JZDataSource(map, "饺子起立"); jzDataSource.looping = true; jzDataSource.currentUrlIndex = 2; jzDataSource.headerMap.put("key", "value");//header mJzvdStd.setUp(jzDataSource , JzvdStd.SCREEN_NORMAL); Jzvd.PROGRESS_DRAG_RATE = 2f;//设置播放进度条手势滑动阻尼系数 - Glide.with(this).load(UrlsKt.getThumbnails()[0]).into(mJzvdStd.posterImageView); + Glide.with(this).load(UrlsKt.getAliThumbnail()[0]).into(mJzvdStd.posterImageView); } diff --git a/demo/src/main/java/cn/jzvd/demo/Tab_3_List/GetGifActivity.java b/demo/src/main/java/cn/jzvd/demo/Tab_3_List/GetGifActivity.java index c409d363..054e7eb7 100644 --- a/demo/src/main/java/cn/jzvd/demo/Tab_3_List/GetGifActivity.java +++ b/demo/src/main/java/cn/jzvd/demo/Tab_3_List/GetGifActivity.java @@ -59,15 +59,9 @@ protected void onCreate(@Nullable Bundle savedInstanceState) { jzDataSource.looping = true; jzDataSource.currentUrlIndex = 2; jzDataSource.headerMap.put("key", "value");//header - jzvdStdGetGif.setUp(jzDataSource - , JzvdStd.SCREEN_NORMAL); + jzvdStdGetGif.setUp(jzDataSource, JzvdStd.SCREEN_NORMAL); Glide.with(this).load(UrlsKt.getThumbnails()[0]).into(jzvdStdGetGif.posterImageView); - - -// String url = "http://jzvd.nathen.cn/342a5f7ef6124a4a8faf00e738b8bee4/cf6d9db0bd4d41f59d09ea0a81e918fd-5287d2089db37e62345123a1be272f8b.mp4"; -// jzvdStdGetGif.setUp(url, "饺子会拼图"); -// Glide.with(this).load("http://jzvd-pic.nathen.cn/jzvd-pic/1bb2ebbe-140d-4e2e-abd2-9e7e564f71ac.png").into(jzvdStdGetGif.posterImageView); } @Override diff --git a/demo/src/main/java/cn/jzvd/demo/Tab_3_List/TinyWindow/TinyWindowActivity.java b/demo/src/main/java/cn/jzvd/demo/Tab_3_List/TinyWindow/TinyWindowActivity.java index d1a132aa..197b1914 100644 --- a/demo/src/main/java/cn/jzvd/demo/Tab_3_List/TinyWindow/TinyWindowActivity.java +++ b/demo/src/main/java/cn/jzvd/demo/Tab_3_List/TinyWindow/TinyWindowActivity.java @@ -10,6 +10,8 @@ import com.bumptech.glide.Glide; +import org.jzvd.jzvideo.UrlsKt; + import cn.jzvd.Jzvd; import cn.jzvd.JzvdStd; import cn.jzvd.demo.CustomJzvd.JzvdStdTinyWindow; @@ -34,10 +36,11 @@ protected void onCreate(@Nullable Bundle savedInstanceState) { setContentView(R.layout.activity_tiny_window); jzvdStdTinyWindow = findViewById(R.id.jz_video); - jzvdStdTinyWindow.setUp("http://jzvd.nathen.cn/342a5f7ef6124a4a8faf00e738b8bee4/cf6d9db0bd4d41f59d09ea0a81e918fd-5287d2089db37e62345123a1be272f8b.mp4", "饺子快长大" + jzvdStdTinyWindow.setUp(UrlsKt.getVideos()[9], + UrlsKt.getTitles()[9] , JzvdStd.SCREEN_NORMAL); Glide.with(this) - .load("http://jzvd-pic.nathen.cn/jzvd-pic/1bb2ebbe-140d-4e2e-abd2-9e7e564f71ac.png") + .load(UrlsKt.getThumbnails()[9]) .into(jzvdStdTinyWindow.posterImageView); } diff --git a/demo/src/main/java/org/jzvd/jzvideo/urls.kt b/demo/src/main/java/org/jzvd/jzvideo/urls.kt index 8cac6f64..9e514108 100644 --- a/demo/src/main/java/org/jzvd/jzvideo/urls.kt +++ b/demo/src/main/java/org/jzvd/jzvideo/urls.kt @@ -50,6 +50,25 @@ val ldjVideos = arrayOf( "http://videos.jzvd.org/v/ldj/44-ldj.mp4", "http://videos.jzvd.org/v/ldj/45-ldj.mp4" ) +val aliVideos = arrayOf( + "https://jzvd.nathen.cn/video/cfe6c30-1767b1bc21f-0007-1823-c86-de200.mp4",//三个不同分辨率 + "https://jzvd.nathen.cn/0339d49439f947419576c33a0aa51545/79e1a938b0d2435d85bd964a77640506-f4e986e3e38ed3f473f7ba82bc07e188-ld.mp4", + "https://jzvd.nathen.cn/0339d49439f947419576c33a0aa51545/79e1a938b0d2435d85bd964a77640506-8924c7da92ebd789d315bc5de0a81059-fd.mp4", + + "https://jzvd.nathen.cn/video/59aa468b-1767b6d891e-0007-1823-c86-de200.mp4",//饺子还小 + "https://jzvd.nathen.cn/video/25ae1b1c-1767b2a5e44-0007-1823-c86-de200.mp4",//饺子还年轻 + "https://jzvd.nathen.cn/video/5a6465ff-1767b2a5e28-0007-1823-c86-de200.mp4", +) + +val aliThumbnail = arrayOf( + "https://jzvd.nathen.cn/snapshot/0339d49439f947419576c33a0aa5154500005.jpg", + "", + "", + + "https://jzvd.nathen.cn/snapshot/61c99f9225c04b24a1d0374e9a3f006700004.jpg", + "https://jzvd.nathen.cn/snapshot/044ef6cf452d48b795cea0a96ee4ea4100002.jpg", + "https://jzvd.nathen.cn/snapshot/a172cc6442ff40ffb826829fc78f83b700005.jpg" +) val videos = arrayOf( "http://videos.jzvd.org/v/饺子还年轻.mp4", @@ -62,6 +81,7 @@ val videos = arrayOf( "http://videos.jzvd.org/v/饺子想听.mp4", "http://videos.jzvd.org/v/饺子想吹.mp4", "http://videos.jzvd.org/v/饺子汪汪.mp4", + "http://videos.jzvd.org/v/饺子偷人.mp4", "http://videos.jzvd.org/v/饺子挺住.mp4", "http://videos.jzvd.org/v/饺子跳.mp4", @@ -72,6 +92,7 @@ val videos = arrayOf( "http://videos.jzvd.org/v/饺子可以了.mp4", "http://videos.jzvd.org/v/饺子可以.mp4", "http://videos.jzvd.org/v/饺子好妈妈.mp4", + "http://videos.jzvd.org/v/饺子还小.mp4", "http://videos.jzvd.org/v/饺子高兴.mp4", "http://videos.jzvd.org/v/饺子高冷.mp4", @@ -92,6 +113,7 @@ val thumbnails = arrayOf( "http://videos.jzvd.org/v/饺子想听.jpg", "http://videos.jzvd.org/v/饺子想吹.jpg", "http://videos.jzvd.org/v/饺子汪汪.jpg", + "http://videos.jzvd.org/v/饺子偷人.jpg", "http://videos.jzvd.org/v/饺子挺住.jpg", "http://videos.jzvd.org/v/饺子跳.jpg", @@ -102,6 +124,7 @@ val thumbnails = arrayOf( "http://videos.jzvd.org/v/饺子可以了.jpg", "http://videos.jzvd.org/v/饺子可以.jpg", "http://videos.jzvd.org/v/饺子好妈妈.jpg", + "http://videos.jzvd.org/v/饺子还小.jpg", "http://videos.jzvd.org/v/饺子高兴.jpg", "http://videos.jzvd.org/v/饺子高冷.jpg", @@ -122,6 +145,7 @@ val titles = arrayOf( "饺子想听", "饺子想吹", "饺子汪汪", + "饺子偷人", "饺子挺住", "饺子跳", @@ -132,6 +156,7 @@ val titles = arrayOf( "饺子可以了", "饺子可以", "饺子好妈妈", + "饺子还小", "饺子高兴", "饺子高冷", @@ -142,16 +167,16 @@ val titles = arrayOf( ) val vl1 = videos.copyOfRange(3, 9) -val pl1 = videos.copyOfRange(3, 9) -val tl1 = videos.copyOfRange(3, 9) +val pl1 = thumbnails.copyOfRange(3, 9) +val tl1 = titles.copyOfRange(3, 9) val vl2 = videos.copyOfRange(10, 20) -val pl2 = videos.copyOfRange(10, 20) -val tl2 = videos.copyOfRange(10, 20) +val pl2 = thumbnails.copyOfRange(10, 20) +val tl2 = titles.copyOfRange(10, 20) -val vl3 = videos.copyOfRange(20, 21) -val pl3 = videos.copyOfRange(20, 21) -val tl3 = videos.copyOfRange(20, 21) +val vl3 = videos.copyOfRange(20, 25) +val pl3 = thumbnails.copyOfRange(20, 25) +val tl3 = titles.copyOfRange(20, 25) val vll = arrayOf( From 135f4c8fad7180d904d8aa68f1b720a390c4960a Mon Sep 17 00:00:00 2001 From: lipangit <1066666651@qq.com> Date: Sat, 26 Dec 2020 05:03:30 +0800 Subject: [PATCH 06/10] change server --- .../java/cn/jzvd/demo/Fragment_1_Base.java | 16 +- demo/src/main/java/org/jzvd/jzvideo/urls.kt | 216 +++++++++--------- .../{fragment_api.xml => fragment_base.xml} | 18 ++ 3 files changed, 145 insertions(+), 105 deletions(-) rename demo/src/main/res/layout/{fragment_api.xml => fragment_base.xml} (78%) diff --git a/demo/src/main/java/cn/jzvd/demo/Fragment_1_Base.java b/demo/src/main/java/cn/jzvd/demo/Fragment_1_Base.java index 381ee3c9..dc61b427 100644 --- a/demo/src/main/java/cn/jzvd/demo/Fragment_1_Base.java +++ b/demo/src/main/java/cn/jzvd/demo/Fragment_1_Base.java @@ -8,6 +8,7 @@ import android.view.View; import android.view.ViewGroup; import android.widget.Button; +import android.widget.Toast; import androidx.annotation.Nullable; import androidx.fragment.app.Fragment; @@ -39,25 +40,30 @@ public class Fragment_1_Base extends Fragment implements View.OnClickListener { private JzvdStd mJzvdStd; private Button mOrientation, mRotationAndVideoSize, mCustomMediaPlayer, mPreLoading, mScreenRotate; + private Button serverCn, serverUs; private Jzvd.JZAutoFullscreenListener mSensorEventListener; private SensorManager mSensorManager; @Nullable @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { - View view = View.inflate(getContext(), R.layout.fragment_api, null); + View view = View.inflate(getContext(), R.layout.fragment_base, null); mJzvdStd = view.findViewById(R.id.jz_video); mOrientation = view.findViewById(R.id.orientation); mRotationAndVideoSize = view.findViewById(R.id.rotation_and_videosize); mCustomMediaPlayer = view.findViewById(R.id.custom_mediaplayer); mPreLoading = view.findViewById(R.id.preloading); mScreenRotate = view.findViewById(R.id.screen_rotate); + serverCn = view.findViewById(R.id.server_cn); + serverUs = view.findViewById(R.id.server_us); mOrientation.setOnClickListener(this); mRotationAndVideoSize.setOnClickListener(this); mCustomMediaPlayer.setOnClickListener(this); mPreLoading.setOnClickListener(this); mScreenRotate.setOnClickListener(this); + serverCn.setOnClickListener(this); + serverUs.setOnClickListener(this); mSensorManager = (SensorManager) getContext().getSystemService(SENSOR_SERVICE); mSensorEventListener = new Jzvd.JZAutoFullscreenListener(); @@ -121,6 +127,14 @@ public void onClick(View view) { case R.id.screen_rotate: startActivity(new Intent(getContext(), ScreenRotateActivity.class)); break; + case R.id.server_cn: + UrlsKt.setServer_name(UrlsKt.getCn()); + Toast.makeText(getContext(), "change server to: " + UrlsKt.getCn(), Toast.LENGTH_SHORT).show(); + break; + case R.id.server_us: + UrlsKt.setServer_name(UrlsKt.getUs()); + Toast.makeText(getContext(), "change server to: " + UrlsKt.getUs(), Toast.LENGTH_SHORT).show(); + break; } } } diff --git a/demo/src/main/java/org/jzvd/jzvideo/urls.kt b/demo/src/main/java/org/jzvd/jzvideo/urls.kt index 9e514108..fee2c82f 100644 --- a/demo/src/main/java/org/jzvd/jzvideo/urls.kt +++ b/demo/src/main/java/org/jzvd/jzvideo/urls.kt @@ -3,53 +3,61 @@ package org.jzvd.jzvideo // Chrome浏览器和饺子demo(android.MediaPlayer)相同时间相同网络环境播放,速度相差很远,为什么。 // ijk好像略快,但没有电脑的chrome快。红米手机的自带浏览器可以完整观看视频无需中途加载。 + +val cn = "http://8.136.101.204" +val us = "http://videos.jzvd.org" + +var server_name: String = cn; + + val ldjVideos = arrayOf( - "http://videos.jzvd.org/v/ldj/01-ldj.mp4", - "http://videos.jzvd.org/v/ldj/02-ldj.mp4", - "http://videos.jzvd.org/v/ldj/03-ldj.mp4", - "http://videos.jzvd.org/v/ldj/04-ldj.mp4", - "http://videos.jzvd.org/v/ldj/05-ldj.mp4", - "http://videos.jzvd.org/v/ldj/06-ldj.mp4", - "http://videos.jzvd.org/v/ldj/07-ldj.mp4", - "http://videos.jzvd.org/v/ldj/08-ldj.mp4", - "http://videos.jzvd.org/v/ldj/09-ldj.mp4", - "http://videos.jzvd.org/v/ldj/10-ldj.mp4", - "http://videos.jzvd.org/v/ldj/11-ldj.mp4", - "http://videos.jzvd.org/v/ldj/12-ldj.mp4", - "http://videos.jzvd.org/v/ldj/13-ldj.mp4", - "http://videos.jzvd.org/v/ldj/14-ldj.mp4", - "http://videos.jzvd.org/v/ldj/15-ldj.mp4", - "http://videos.jzvd.org/v/ldj/16-ldj.mp4", - "http://videos.jzvd.org/v/ldj/17-ldj.mp4", - "http://videos.jzvd.org/v/ldj/18-ldj.mp4", - "http://videos.jzvd.org/v/ldj/19-ldj.mp4", - "http://videos.jzvd.org/v/ldj/20-ldj.mp4", - "http://videos.jzvd.org/v/ldj/21-ldj.mp4", - "http://videos.jzvd.org/v/ldj/22-ldj.mp4", - "http://videos.jzvd.org/v/ldj/23-ldj.mp4", - "http://videos.jzvd.org/v/ldj/24-ldj.mp4", - "http://videos.jzvd.org/v/ldj/25-ldj.mp4", - "http://videos.jzvd.org/v/ldj/26-ldj.mp4", - "http://videos.jzvd.org/v/ldj/27-ldj.mp4", - "http://videos.jzvd.org/v/ldj/28-ldj.mp4", - "http://videos.jzvd.org/v/ldj/29-ldj.mp4", - "http://videos.jzvd.org/v/ldj/30-ldj.mp4", - "http://videos.jzvd.org/v/ldj/31-ldj.mp4", - "http://videos.jzvd.org/v/ldj/32-ldj.mp4", - "http://videos.jzvd.org/v/ldj/33-ldj.mp4", - "http://videos.jzvd.org/v/ldj/34-ldj.mp4", - "http://videos.jzvd.org/v/ldj/35-ldj.mp4", - "http://videos.jzvd.org/v/ldj/36-ldj.mp4", - "http://videos.jzvd.org/v/ldj/37-ldj.mp4", - "http://videos.jzvd.org/v/ldj/38-ldj.mp4", - "http://videos.jzvd.org/v/ldj/39-ldj.mp4", - "http://videos.jzvd.org/v/ldj/40-ldj.mp4", - "http://videos.jzvd.org/v/ldj/41-ldj.mp4", - "http://videos.jzvd.org/v/ldj/42-ldj.mp4", - "http://videos.jzvd.org/v/ldj/43-ldj.mp4", - "http://videos.jzvd.org/v/ldj/44-ldj.mp4", - "http://videos.jzvd.org/v/ldj/45-ldj.mp4" + "$server_name/v/ldj/01-ldj.mp4", + "$server_name/v/ldj/02-ldj.mp4", + "$server_name/v/ldj/03-ldj.mp4", + "$server_name/v/ldj/04-ldj.mp4", + "$server_name/v/ldj/05-ldj.mp4", + "$server_name/v/ldj/06-ldj.mp4", + "$server_name/v/ldj/07-ldj.mp4", + "$server_name/v/ldj/08-ldj.mp4", + "$server_name/v/ldj/09-ldj.mp4", + "$server_name/v/ldj/10-ldj.mp4", + "$server_name/v/ldj/11-ldj.mp4", + "$server_name/v/ldj/12-ldj.mp4", + "$server_name/v/ldj/13-ldj.mp4", + "$server_name/v/ldj/14-ldj.mp4", + "$server_name/v/ldj/15-ldj.mp4", + "$server_name/v/ldj/16-ldj.mp4", + "$server_name/v/ldj/17-ldj.mp4", + "$server_name/v/ldj/18-ldj.mp4", + "$server_name/v/ldj/19-ldj.mp4", + "$server_name/v/ldj/20-ldj.mp4", + "$server_name/v/ldj/21-ldj.mp4", + "$server_name/v/ldj/22-ldj.mp4", + "$server_name/v/ldj/23-ldj.mp4", + "$server_name/v/ldj/24-ldj.mp4", + "$server_name/v/ldj/25-ldj.mp4", + "$server_name/v/ldj/26-ldj.mp4", + "$server_name/v/ldj/27-ldj.mp4", + "$server_name/v/ldj/28-ldj.mp4", + "$server_name/v/ldj/29-ldj.mp4", + "$server_name/v/ldj/30-ldj.mp4", + "$server_name/v/ldj/31-ldj.mp4", + "$server_name/v/ldj/32-ldj.mp4", + "$server_name/v/ldj/33-ldj.mp4", + "$server_name/v/ldj/34-ldj.mp4", + "$server_name/v/ldj/35-ldj.mp4", + "$server_name/v/ldj/36-ldj.mp4", + "$server_name/v/ldj/37-ldj.mp4", + "$server_name/v/ldj/38-ldj.mp4", + "$server_name/v/ldj/39-ldj.mp4", + "$server_name/v/ldj/40-ldj.mp4", + "$server_name/v/ldj/41-ldj.mp4", + "$server_name/v/ldj/42-ldj.mp4", + "$server_name/v/ldj/43-ldj.mp4", + "$server_name/v/ldj/44-ldj.mp4", + "$server_name/v/ldj/45-ldj.mp4" ) + val aliVideos = arrayOf( "https://jzvd.nathen.cn/video/cfe6c30-1767b1bc21f-0007-1823-c86-de200.mp4",//三个不同分辨率 "https://jzvd.nathen.cn/0339d49439f947419576c33a0aa51545/79e1a938b0d2435d85bd964a77640506-f4e986e3e38ed3f473f7ba82bc07e188-ld.mp4", @@ -57,7 +65,7 @@ val aliVideos = arrayOf( "https://jzvd.nathen.cn/video/59aa468b-1767b6d891e-0007-1823-c86-de200.mp4",//饺子还小 "https://jzvd.nathen.cn/video/25ae1b1c-1767b2a5e44-0007-1823-c86-de200.mp4",//饺子还年轻 - "https://jzvd.nathen.cn/video/5a6465ff-1767b2a5e28-0007-1823-c86-de200.mp4", + "https://jzvd.nathen.cn/video/5a6465ff-1767b2a5e28-0007-1823-c86-de200.mp4" ) val aliThumbnail = arrayOf( @@ -71,67 +79,67 @@ val aliThumbnail = arrayOf( ) val videos = arrayOf( - "http://videos.jzvd.org/v/饺子还年轻.mp4", - "http://videos.jzvd.org/v/饺子主动.mp4", - "http://videos.jzvd.org/v/饺子真萌.mp4", - "http://videos.jzvd.org/v/饺子真会.mp4", - "http://videos.jzvd.org/v/饺子运动.mp4", - "http://videos.jzvd.org/v/饺子有活.mp4", - "http://videos.jzvd.org/v/饺子星光.mp4", - "http://videos.jzvd.org/v/饺子想听.mp4", - "http://videos.jzvd.org/v/饺子想吹.mp4", - "http://videos.jzvd.org/v/饺子汪汪.mp4", - - "http://videos.jzvd.org/v/饺子偷人.mp4", - "http://videos.jzvd.org/v/饺子挺住.mp4", - "http://videos.jzvd.org/v/饺子跳.mp4", - "http://videos.jzvd.org/v/饺子受不了.mp4", - "http://videos.jzvd.org/v/饺子三位.mp4", - "http://videos.jzvd.org/v/饺子起飞.mp4", - "http://videos.jzvd.org/v/饺子你听.mp4", - "http://videos.jzvd.org/v/饺子可以了.mp4", - "http://videos.jzvd.org/v/饺子可以.mp4", - "http://videos.jzvd.org/v/饺子好妈妈.mp4", - - "http://videos.jzvd.org/v/饺子还小.mp4", - "http://videos.jzvd.org/v/饺子高兴.mp4", - "http://videos.jzvd.org/v/饺子高冷.mp4", - "http://videos.jzvd.org/v/饺子堵住了.mp4", - "http://videos.jzvd.org/v/饺子都懂.mp4", - "http://videos.jzvd.org/v/饺子打电话.mp4", - "http://videos.jzvd.org/v/饺子不服.mp4" + "$server_name/v/饺子还年轻.mp4", + "$server_name/v/饺子主动.mp4", + "$server_name/v/饺子真萌.mp4", + "$server_name/v/饺子真会.mp4", + "$server_name/v/饺子运动.mp4", + "$server_name/v/饺子有活.mp4", + "$server_name/v/饺子星光.mp4", + "$server_name/v/饺子想听.mp4", + "$server_name/v/饺子想吹.mp4", + "$server_name/v/饺子汪汪.mp4", + + "$server_name/v/饺子偷人.mp4", + "$server_name/v/饺子挺住.mp4", + "$server_name/v/饺子跳.mp4", + "$server_name/v/饺子受不了.mp4", + "$server_name/v/饺子三位.mp4", + "$server_name/v/饺子起飞.mp4", + "$server_name/v/饺子你听.mp4", + "$server_name/v/饺子可以了.mp4", + "$server_name/v/饺子可以.mp4", + "$server_name/v/饺子好妈妈.mp4", + + "$server_name/v/饺子还小.mp4", + "$server_name/v/饺子高兴.mp4", + "$server_name/v/饺子高冷.mp4", + "$server_name/v/饺子堵住了.mp4", + "$server_name/v/饺子都懂.mp4", + "$server_name/v/饺子打电话.mp4", + "$server_name/v/饺子不服.mp4" ) val thumbnails = arrayOf( - "http://videos.jzvd.org/v/饺子还年轻.jpg", - "http://videos.jzvd.org/v/饺子主动.jpg", - "http://videos.jzvd.org/v/饺子真萌.jpg", - "http://videos.jzvd.org/v/饺子真会.jpg", - "http://videos.jzvd.org/v/饺子运动.jpg", - "http://videos.jzvd.org/v/饺子有活.jpg", - "http://videos.jzvd.org/v/饺子星光.jpg", - "http://videos.jzvd.org/v/饺子想听.jpg", - "http://videos.jzvd.org/v/饺子想吹.jpg", - "http://videos.jzvd.org/v/饺子汪汪.jpg", - - "http://videos.jzvd.org/v/饺子偷人.jpg", - "http://videos.jzvd.org/v/饺子挺住.jpg", - "http://videos.jzvd.org/v/饺子跳.jpg", - "http://videos.jzvd.org/v/饺子受不了.jpg", - "http://videos.jzvd.org/v/饺子三位.jpg", - "http://videos.jzvd.org/v/饺子起飞.jpg", - "http://videos.jzvd.org/v/饺子你听.jpg", - "http://videos.jzvd.org/v/饺子可以了.jpg", - "http://videos.jzvd.org/v/饺子可以.jpg", - "http://videos.jzvd.org/v/饺子好妈妈.jpg", - - "http://videos.jzvd.org/v/饺子还小.jpg", - "http://videos.jzvd.org/v/饺子高兴.jpg", - "http://videos.jzvd.org/v/饺子高冷.jpg", - "http://videos.jzvd.org/v/饺子堵住了.jpg", - "http://videos.jzvd.org/v/饺子都懂.jpg", - "http://videos.jzvd.org/v/饺子打电话.jpg", - "http://videos.jzvd.org/v/饺子不服.jpg" + "$server_name/v/饺子还年轻.jpg", + "$server_name/v/饺子主动.jpg", + "$server_name/v/饺子真萌.jpg", + "$server_name/v/饺子真会.jpg", + "$server_name/v/饺子运动.jpg", + "$server_name/v/饺子有活.jpg", + "$server_name/v/饺子星光.jpg", + "$server_name/v/饺子想听.jpg", + "$server_name/v/饺子想吹.jpg", + "$server_name/v/饺子汪汪.jpg", + + "$server_name/v/饺子偷人.jpg", + "$server_name/v/饺子挺住.jpg", + "$server_name/v/饺子跳.jpg", + "$server_name/v/饺子受不了.jpg", + "$server_name/v/饺子三位.jpg", + "$server_name/v/饺子起飞.jpg", + "$server_name/v/饺子你听.jpg", + "$server_name/v/饺子可以了.jpg", + "$server_name/v/饺子可以.jpg", + "$server_name/v/饺子好妈妈.jpg", + + "$server_name/v/饺子还小.jpg", + "$server_name/v/饺子高兴.jpg", + "$server_name/v/饺子高冷.jpg", + "$server_name/v/饺子堵住了.jpg", + "$server_name/v/饺子都懂.jpg", + "$server_name/v/饺子打电话.jpg", + "$server_name/v/饺子不服.jpg" ) val titles = arrayOf( diff --git a/demo/src/main/res/layout/fragment_api.xml b/demo/src/main/res/layout/fragment_base.xml similarity index 78% rename from demo/src/main/res/layout/fragment_api.xml rename to demo/src/main/res/layout/fragment_base.xml index 829d1d36..5350ded7 100644 --- a/demo/src/main/res/layout/fragment_api.xml +++ b/demo/src/main/res/layout/fragment_base.xml @@ -59,6 +59,24 @@ android:layout_marginBottom="8dp" android:text="@string/screen_rotate" /> + + +