@shijiu/jsview-vue-samples 2.3.0 → 2.3.728-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ABImageAlt/App.vue +114 -0
- package/ABImageAlt/Item.vue +133 -0
- package/{MetroWidgetDemos/SkeletonDiagram/assets/imageList.json → ABImageAlt/assets/imageList.js} +9 -1
- package/ABImageAlt/data.js +17 -0
- package/AI_Check_Rules.txt +5 -0
- package/AnimPicture/App.vue +20 -10
- package/ApicSwitch/App.vue +90 -0
- package/ApicSwitch/TabItem.vue +65 -0
- package/ApicSwitch/WebpShow.vue +24 -0
- package/ApicSwitch/data.js +50 -0
- package/Basic/AI_skills_update.md +1 -0
- package/Basic/components/div/ColorFormatTest.vue +93 -0
- package/Basic/components/div/DivRadius.vue +97 -15
- package/Basic/components/div/DivTag3Group.vue +30 -0
- package/Basic/components/img/ImageType.vue +65 -0
- package/Basic/components/panel/Panel2.vue +13 -1
- package/Basic/components/text/TextAlign.vue +7 -1
- package/BlobLoadTest/App.vue +201 -0
- package/BreakLinesApi/App.vue +82 -0
- package/CanvasDrawChart/App.vue +11 -0
- package/CanvasDrawChart/Graph1.vue +104 -0
- package/CanvasDrawChart/Graph2.vue +115 -0
- package/DashPath/App.vue +17 -16
- package/DashPath/AppForOperator.vue +2 -4
- package/DemoForOperator/AnimPic/AnimPic.vue +24 -2
- package/DemoForOperator/Banger/Banger/Banger.vue +73 -9
- package/DemoForOperator/Blur/Blur.vue +146 -0
- package/DemoForOperator/Blur/BlurInOut/BlurInOut.vue +184 -0
- package/DemoForOperator/Blur/BlurInOut/StaticBgSlide.vue +162 -0
- package/DemoForOperator/Blur/BlurPopup/BlurPopup.vue +249 -0
- package/DemoForOperator/BookFlip/App.vue +115 -0
- package/DemoForOperator/BookFlip/BookPage.vue +82 -0
- package/DemoForOperator/Bounce/Bounce.vue +33 -1
- package/DemoForOperator/Bounce/FreeMoveBuilder.js +1 -1
- package/DemoForOperator/ChunLian/Couplets.vue +44 -1
- package/DemoForOperator/ClickSpriteAnim/App.vue +130 -0
- package/DemoForOperator/ClickSpriteAnim/Item.vue +74 -0
- package/DemoForOperator/DominantColor/App.vue +187 -0
- package/DemoForOperator/EpisodeList/EpisodeList/Controller.vue +0 -3
- package/DemoForOperator/EpisodeList/EpisodeList/EpisodeList.vue +76 -2
- package/DemoForOperator/Firework1/App.vue +13 -2
- package/DemoForOperator/Firework1/Fireworks.vue +68 -11
- package/DemoForOperator/FlipPage/FlipPage/FlipPage.vue +30 -1
- package/DemoForOperator/Focus/Alpha/AlphaFocusBox.vue +27 -2
- package/DemoForOperator/Focus/Alpha/Item.vue +1 -0
- package/DemoForOperator/Focus/Light/Item.vue +1 -0
- package/DemoForOperator/Focus/Light/LightFocusBox.vue +42 -1
- package/DemoForOperator/Focus/Normal/Item.vue +1 -0
- package/DemoForOperator/Focus/Normal/NormalFocusBox.vue +12 -0
- package/DemoForOperator/FrameShadow/App.vue +193 -0
- package/DemoForOperator/FrameShadow/FrameShadow.vue +61 -0
- package/DemoForOperator/FullscreenIn/App.vue +1 -1
- package/DemoForOperator/FullscreenIn/FullscreenPoster.vue +18 -3
- package/DemoForOperator/Genie/App.vue +20 -6
- package/DemoForOperator/Genie/App2.vue +61 -0
- package/DemoForOperator/Genie/geniePakcer/GenieImage.vue +298 -0
- package/DemoForOperator/Genie/geniePakcer/GenieSlot.vue +292 -0
- package/DemoForOperator/Genie/geniePakcer/GenieTools.ts +463 -0
- package/DemoForOperator/GrayFilter/GrayFilter.vue +21 -0
- package/DemoForOperator/Jigsaw/JigsawFull.vue +58 -11
- package/DemoForOperator/Jigsaw/JigsawSingle.vue +47 -9
- package/DemoForOperator/LongChatBox/App.vue +36 -0
- package/DemoForOperator/LongChatBox/Bubble.vue +116 -0
- package/DemoForOperator/LongChatBox/LongChat.vue +204 -0
- package/DemoForOperator/LongChatBox/testData.js +14 -0
- package/DemoForOperator/Particle/Drop/DropParticle.vue +33 -1
- package/DemoForOperator/Particle/Explode/ExplodeParticle.vue +23 -2
- package/DemoForOperator/PosterAnim/PosterAnim.js +21 -0
- package/DemoForOperator/PosterOverflow/PosterOverflow.vue +16 -0
- package/DemoForOperator/Resize/App.vue +157 -0
- package/DemoForOperator/Resize/Resize/Item.vue +234 -0
- package/DemoForOperator/Resize/Resize/Resize.vue +96 -0
- package/DemoForOperator/Ripple/Ripple.vue +16 -1
- package/DemoForOperator/ScreenShootScale/App.vue +96 -0
- package/DemoForOperator/ScreenShootScale/Back.vue +86 -0
- package/DemoForOperator/ScreenShootScale/Front.vue +133 -0
- package/DemoForOperator/ScreenShootScale/Item.vue +62 -0
- package/DemoForOperator/ScreenShootScale/ScreenShootScale.vue +109 -0
- package/DemoForOperator/SmoothSwiper/App.vue +50 -0
- package/DemoForOperator/Sound/Bounce/App.vue +56 -0
- package/DemoForOperator/Sound/Bounce/Bounce.vue +87 -0
- package/DemoForOperator/Sound/Bounce/FreeMoveBuilder.js +146 -0
- package/DemoForOperator/Sound/Bounce/bgmusic.mp3 +0 -0
- package/DemoForOperator/Sound/Bounce/coin.mp3 +0 -0
- package/DemoForOperator/Sound/FocusMove/App.vue +134 -0
- package/DemoForOperator/Sound/FocusMove/Item.vue +43 -0
- package/DemoForOperator/Sound/FocusMove/move.mp3 +0 -0
- package/DemoForOperator/Sound/Rain/App.vue +11 -0
- package/DemoForOperator/Sound/Rain/Raining/Rain.vue +69 -0
- package/DemoForOperator/Sound/Rain/Raining/RainScene.vue +118 -0
- package/DemoForOperator/Sound/Sound/Sound.vue +24 -0
- package/DemoForOperator/Sound/Sound/index.js +4 -0
- package/DemoForOperator/Sound/Sound/useSound.js +112 -0
- package/DemoForOperator/Sprite/Sprite.vue +62 -5
- package/DemoForOperator/Stretch/Stretch/Stretch.vue +52 -2
- package/DemoForOperator/Swiper/App.vue +101 -0
- package/DemoForOperator/Swiper/Item.vue +56 -0
- package/DemoForOperator/Swiper/ParallaxSlide.vue +164 -0
- package/DemoForOperator/TabContent/TabContent/TabContent.vue +39 -1
- package/DemoForOperator/TabContentVertical/App.vue +104 -0
- package/DemoForOperator/TabContentVertical/ContentPage.vue +67 -0
- package/DemoForOperator/TabContentVertical/Item.vue +94 -0
- package/DemoForOperator/TabContentVertical/PageItem.vue +40 -0
- package/DemoForOperator/TabContentVertical/TabContent/CreepFocus.vue +160 -0
- package/DemoForOperator/TabContentVertical/TabContent/Item.vue +63 -0
- package/DemoForOperator/TabContentVertical/TabContent/TabContent.vue +184 -0
- package/DemoForOperator/TabContentVertical/TabContent/TabItem.vue +368 -0
- package/DemoForOperator/TabContentVertical/TabContent/TabWidget.vue +259 -0
- package/DemoForOperator/TabContentVertical/TabContent/Util.js +3 -0
- package/DemoForOperator/TabContentVertical/TabContent/ViewSwiper.vue +110 -0
- package/DemoForOperator/TabContentVertical/assets/children_science.png +0 -0
- package/DemoForOperator/TabContentVertical/assets/documentary.png +0 -0
- package/DemoForOperator/TabContentVertical/assets/free.png +0 -0
- package/DemoForOperator/TabContentVertical/assets/game.png +0 -0
- package/DemoForOperator/TabContentVertical/assets/home_selected.png +0 -0
- package/DemoForOperator/TabContentVertical/assets/movie_ticket.png +0 -0
- package/DemoForOperator/TabContentVertical/assets/my_account.png +0 -0
- package/DemoForOperator/TabContentVertical/assets/opera.png +0 -0
- package/DemoForOperator/TabContentVertical/assets/sports.png +0 -0
- package/DemoForOperator/TabContentVertical/assets/tv_drama.png +0 -0
- package/DemoForOperator/TabContentVertical/assets/variety_show.png +0 -0
- package/DemoForOperator/TabContentVertical/assets/vip.png +0 -0
- package/DemoForOperator/TabContentVertical/testData.js +76 -0
- package/DemoForOperator/Vortex/Vortex/Vortex.vue +26 -0
- package/DemoForOperator/routeList.js +125 -2
- package/DemoHomepage/App.vue +74 -1
- package/DemoHomepage/components/BodyFrame.vue +5 -0
- package/DemoHomepage/components/Item.vue +11 -0
- package/DemoHomepage/components/TabFrame.vue +1 -1
- package/DemoHomepage/router.js +798 -140
- package/DemoHomepage/views/Homepage.vue +60 -2
- package/DemoHomepage/watchTest.vue +50 -0
- package/DomRenderer/App.vue +133 -0
- package/FilterDemo/AnimatePic.vue +63 -17
- package/FilterDemo/App.vue +3 -3
- package/FlexCellDemo/AI_skills_update.md +4 -0
- package/FlexCellDemo/TestFrame1.vue +12 -2
- package/FlexCellDemo/TestFrame2.vue +10 -1
- package/FlexCellDemo/TestFrame3.vue +114 -59
- package/FpsLimit/App.vue +102 -0
- package/FreeMove/App.vue +24 -279
- package/FreeMove/TestScene1.vue +260 -0
- package/FreeMove/TestScene3.vue +431 -0
- package/FreeMoveChildAttract/App.vue +18 -8
- package/FreeMoveLink/App.vue +51 -22
- package/GiftRain/components/SpriteTranslate.vue +68 -48
- package/HashHistory/App.vue +2 -2
- package/HashHistory/router.js +1 -1
- package/Hover/App.vue +144 -0
- package/HttpRequestSSE/SSEReader.js +200 -0
- package/ImpactStop/App.vue +2 -2
- package/Input/FullKeyboard.vue +3 -3
- package/Input/InputPanel.vue +63 -3
- package/JsvLine/App.vue +53 -38
- package/LatexDemo/App.vue +3 -1
- package/LatexFormula/App.vue +196 -0
- package/LongImage/App.vue +1 -1
- package/LongImage/LongImageScroll.vue +111 -46
- package/LongImage/Scroll.vue +28 -9
- package/LongText/LongTextScroll.vue +14 -1
- package/Markdown/App.vue +36 -0
- package/Markdown/Bubble.vue +109 -0
- package/Markdown/LongChat.vue +216 -0
- package/Markdown/data.js +633 -0
- package/MetroWidgetDemos/AI_skills_update.md +2 -0
- package/MetroWidgetDemos/EpgFlowListType/App.vue +206 -0
- package/MetroWidgetDemos/EpgFlowListType/components/ContentCard.vue +105 -0
- package/MetroWidgetDemos/EpgFlowListType/components/FloorSection.vue +131 -0
- package/MetroWidgetDemos/EpgFlowListType/components/LeftTabItem.vue +41 -0
- package/MetroWidgetDemos/EpgFlowListType/data.js +78 -0
- package/MetroWidgetDemos/ListExpand/ChildItem.vue +130 -0
- package/MetroWidgetDemos/ListExpand/ExpandItem.vue +375 -0
- package/MetroWidgetDemos/ListExpand/ExpandItem1.vue +403 -0
- package/MetroWidgetDemos/ListExpand/assets/arrow-down.png +0 -0
- package/MetroWidgetDemos/ListExpand/assets/up-arrow.png +0 -0
- package/MetroWidgetDemos/ListExpand/components/WidgetListHandler.vue +150 -0
- package/MetroWidgetDemos/ListExpand/index.vue +88 -0
- package/MetroWidgetDemos/ListExpand/list.js +2421 -0
- package/MetroWidgetDemos/RefreshDemo/App.vue +14 -1
- package/MetroWidgetDemos/RenderAccelerate/App.vue +142 -0
- package/MetroWidgetDemos/RenderAccelerate/AppPage.vue +78 -0
- package/MetroWidgetDemos/RenderAccelerate/AppTab.vue +62 -0
- package/MetroWidgetDemos/RenderAccelerate/ContentItem.vue +409 -0
- package/MetroWidgetDemos/{TripleWidget → RenderAccelerate}/Item.vue +6 -3
- package/MetroWidgetDemos/RenderAccelerate/TabItem.vue +100 -0
- package/MetroWidgetDemos/RenderAccelerate/ViewSwiper.vue +215 -0
- package/MetroWidgetDemos/RenderAccelerate/WidgetItem.vue +107 -0
- package/MetroWidgetDemos/SkeletonDiagram/App.vue +35 -8
- package/MetroWidgetDemos/SkeletonDiagram/Item.vue +11 -2
- package/MetroWidgetDemos/SkeletonDiagram/assets/imageList.js +245 -0
- package/MetroWidgetDemos/SkeletonDiagram/data.js +3 -3
- package/MetroWidgetDemos/SpatialNav/App.vue +177 -0
- package/MetroWidgetDemos/SpatialNav/Buttons.vue +83 -0
- package/MetroWidgetDemos/SpatialNav/CustomFocus.vue +57 -0
- package/MetroWidgetDemos/SpatialNav/Item.vue +71 -0
- package/MetroWidgetDemos/SpatialNav/SimpleFloor.vue +86 -0
- package/MetroWidgetDemos/SpatialNav/StepMw.vue +113 -0
- package/MetroWidgetDemos/SpatialNav/TabContent/TabContent.vue +185 -0
- package/MetroWidgetDemos/SpatialNav/TripleSection/TripleSection.vue +69 -0
- package/MetroWidgetDemos/SpatialNav/TripleSection/WidgetItem.vue +100 -0
- package/MetroWidgetDemos/SpatialNav/TvSection/List.vue +75 -0
- package/MetroWidgetDemos/SpatialNav/TvSection/TvSection.vue +91 -0
- package/MetroWidgetDemos/basic2/App.vue +407 -0
- package/MetroWidgetDemos/basic2/Item.vue +68 -0
- package/MetroWidgetDemos/direction/App.vue +22 -0
- package/MetroWidgetDemos/gazeFocusDiff/App.vue +126 -0
- package/MetroWidgetDemos/gazeFocusDiff/Item.vue +87 -0
- package/MetroWidgetDemos/minimalUsage/App.vue +66 -0
- package/MetroWidgetDemos/minimalUsage/Item.vue +54 -0
- package/MetroWidgetDemos/ninePatchFocusPage/App.vue +23 -7
- package/MetroWidgetDemos/ninePatchFocusPage/Item.vue +7 -5
- package/MetroWidgetDemos/ninePatchFocusPage/focusConstants.js +2 -0
- package/MetroWidgetDemos/routeList.js +229 -8
- package/MetroWidgetDemos/slideSetting/App.vue +288 -99
- package/MetroWidgetDemos/zIndex/App.vue +117 -0
- package/MetroWidgetDemos/zIndex/Item.vue +61 -0
- package/NinePatchTester/App.vue +24 -31
- package/PosterPacker/App.vue +2 -2
- package/PreDecode/App.vue +140 -0
- package/ReactiveTest/App.vue +115 -0
- package/ReactiveTest/Item.vue +92 -0
- package/ReactiveTest/assets/imageList.js +245 -0
- package/ReactiveTest/component/TestSmartDiv.vue +50 -0
- package/ReactiveTest/component/TestSmartDivSrcList.vue +74 -0
- package/ReactiveTest/component/TestSmartImage.vue +46 -0
- package/ReactiveTest/component/TestSmartImageSrcList.vue +90 -0
- package/ReactiveTest/component/TestSmartImageStyle.vue +41 -0
- package/ReactiveTest/data.js +49 -0
- package/ScreenToBlob/App.vue +250 -0
- package/ScrollBoxTest/App.vue +52 -28
- package/ScrollBoxTest/ClipBar.vue +64 -2
- package/ScrollBoxTest/NinePatchBar.vue +64 -2
- package/ScrollBoxTest/SizeDivBar.vue +64 -2
- package/SecTorTest/App.vue +9 -3
- package/SpringFestival/SpringFestivalScene/FreeMoveBuilder.js +3 -3
- package/SyncDecode/App.vue +137 -0
- package/TextSizeLimit/App.vue +211 -0
- package/TextureAnimation/App3.vue +11 -1
- package/TouchWidget/App.vue +90 -5
- package/TouchWidget/WidgetItem.vue +1 -0
- package/TransitPage/App.vue +2 -0
- package/ViewOpacity/App.vue +19 -0
- package/assets/logo.png +0 -0
- package/package.json +1 -1
- package/DashPath/DashPath.vue +0 -118
- package/DemoForOperator/Genie/geniePakcer/Genie.vue +0 -699
- package/DemoForOperator/ScalePoster/App.vue +0 -4
- package/DemoForOperator/ScalePoster/ScalePoster.vue +0 -0
- package/DivMetroPerformance/App.vue +0 -157
- package/DivMetroPerformance/Item.vue +0 -58
- package/DivMetroPerformance/assets/bg.jpg +0 -0
- package/DivMetroPerformance/assets/coupon_content.png +0 -0
- package/DivMetroPerformance/assets/coupon_left.png +0 -0
- package/DivMetroPerformance/assets/coupon_mid.png +0 -0
- package/DivMetroPerformance/assets/coupon_right.png +0 -0
- package/DivMetroPerformance/assets/focus_border.png +0 -0
- package/DivMetroPerformance/assets/holder_logo.png +0 -0
- package/DivMetroPerformance/assets/jrbm.png +0 -0
- package/DivMetroPerformance/assets/line_left.png +0 -0
- package/DivMetroPerformance/assets/line_mid.png +0 -0
- package/DivMetroPerformance/assets/line_right.png +0 -0
- package/DivMetroPerformance/assets/loading.png +0 -0
- package/DivMetroPerformance/assets/logo.png +0 -0
- package/DivMetroPerformance/assets/mcjx.png +0 -0
- package/DivMetroPerformance/assets/tao.png +0 -0
- package/DivMetroPerformance/assets/tmall.png +0 -0
- package/DivMetroPerformance/border.png +0 -0
- package/DivMetroPerformance/components/ContentItem.vue +0 -384
- package/DivMetroPerformance/components/MyTab.vue +0 -129
- package/DivMetroPerformance/data.js +0 -124
- package/DivMetroPerformance/utils/GridItem.vue +0 -28
- package/DivMetroPerformance/utils/GridPlate.vue +0 -85
- package/MediaDemo/App.vue +0 -127
- package/MediaDemo/assets/audio-poster.png +0 -0
- package/MediaDemo/components/Button.vue +0 -69
- package/MediaDemo/components/Controllor.vue +0 -286
- package/MediaDemo/components/StatusBar.vue +0 -100
- package/MediaDemo/components/frames/AudioFrame.vue +0 -39
- package/MediaDemo/components/frames/AudioPoster.vue +0 -48
- package/MediaDemo/components/frames/MediaFrame.vue +0 -153
- package/MediaDemo/components/frames/VideoFrame.vue +0 -39
- package/MetroWidgetDemos/TripleWidget/App.vue +0 -81
- package/MetroWidgetDemos/TripleWidget/SWidgetItem.vue +0 -93
- package/MetroWidgetDemos/TripleWidget/WidgetItem.vue +0 -111
- package/Parkour/App.vue +0 -13
- package/Parkour/Common/Context.js +0 -21
- package/Parkour/Common/MatchmanInfo.js +0 -62
- package/Parkour/Common/Random.js +0 -61
- package/Parkour/Common/Sound.js +0 -50
- package/Parkour/appConfig/HOW_TO_CONFIG.md +0 -20
- package/Parkour/appConfig/app.config.mjs +0 -5
- package/Parkour/appConfig/app_sign_private_key_sample.crt +0 -28
- package/Parkour/appConfig/app_sign_public_key_sample.pem +0 -9
- package/Parkour/appConfig/jsview.config.mjs +0 -39
- package/Parkour/assets/Bgimages/bg1.png +0 -0
- package/Parkour/assets/Bgimages/bg2.png +0 -0
- package/Parkour/assets/Bgimages/bg3.png +0 -0
- package/Parkour/assets/Bgimages/bg4.png +0 -0
- package/Parkour/assets/Bgimages/bg5.png +0 -0
- package/Parkour/assets/audio/jump.mp3 +0 -0
- package/Parkour/assets/audio/lose.mp3 +0 -0
- package/Parkour/assets/role_skin1/fail.json +0 -44
- package/Parkour/assets/role_skin1/fail.png +0 -0
- package/Parkour/assets/role_skin1/jump_down.json +0 -20
- package/Parkour/assets/role_skin1/jump_down.png +0 -0
- package/Parkour/assets/role_skin1/jump_up.json +0 -44
- package/Parkour/assets/role_skin1/jump_up.png +0 -0
- package/Parkour/assets/role_skin1/roll.json +0 -44
- package/Parkour/assets/role_skin1/roll.png +0 -0
- package/Parkour/assets/role_skin1/run.json +0 -52
- package/Parkour/assets/role_skin1/run.png +0 -0
- package/Parkour/components/Backdrop.vue +0 -61
- package/Parkour/components/GameSence.vue +0 -602
- package/Parkour/components/Matchman.vue +0 -85
- package/TextureAnimation/utils/FrameCanvasStore.ts +0 -68
- package/TextureAnimation/utils/RotateFrame.vue +0 -146
- package/TextureAnimation/utils/circleHaloMask.png +0 -0
- package/ThrowMoveDemo/AccelerateDemo.vue +0 -85
- package/ThrowMoveDemo/App.vue +0 -104
- package/ThrowMoveDemo/LRParabolicDemo.vue +0 -101
- package/ThrowMoveDemo/TargetDemo.vue +0 -87
- package/ThrowMoveDemo/UDParabolicDemo.vue +0 -92
- /package/{AnimPicture/assets → assets}/animated_webp.webp +0 -0
- /package/{AnimPicture/assets → assets}/ball_3.webp +0 -0
- /package/{AnimPicture/assets → assets}/girl_run.gif +0 -0
- /package/{AnimPicture/assets → assets}/quan.webp +0 -0
|
@@ -1,286 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import { inject } from 'vue'
|
|
3
|
-
import { Options, Vue } from "vue-class-component";
|
|
4
|
-
import { useFocusHub } from 'jsview';
|
|
5
|
-
import Button from "./Button.vue";
|
|
6
|
-
|
|
7
|
-
@Options({
|
|
8
|
-
props: {
|
|
9
|
-
style: { type: Object, default: {width:1400,height:50} },
|
|
10
|
-
},
|
|
11
|
-
components: {
|
|
12
|
-
Button,
|
|
13
|
-
},
|
|
14
|
-
})
|
|
15
|
-
|
|
16
|
-
class Controllor extends Vue {
|
|
17
|
-
constructor(props) {
|
|
18
|
-
super(props);
|
|
19
|
-
|
|
20
|
-
this.mediaCtrl = inject('mediaCtrl');
|
|
21
|
-
this.mediaTime = inject('mediaTime');
|
|
22
|
-
this.mediaStatus = inject('mediaStatus');
|
|
23
|
-
this.videoCtrl = inject('videoCtrl');
|
|
24
|
-
|
|
25
|
-
this.buttonList = this.getButtonList();
|
|
26
|
-
|
|
27
|
-
this.playbackRateData = [
|
|
28
|
-
{ name: "1.0", playbackRate: 1.0 },
|
|
29
|
-
{ name: "2.0", playbackRate: 2.0 },
|
|
30
|
-
{ name: "4.0", playbackRate: 4.0 },
|
|
31
|
-
{ name: "0.5", playbackRate: 0.5 },
|
|
32
|
-
{ name: "0.25", playbackRate: 0.25 },
|
|
33
|
-
{ name: "-1.0", playbackRate: -1.0 },
|
|
34
|
-
];
|
|
35
|
-
this.playbackRateIndex = 0;
|
|
36
|
-
|
|
37
|
-
this.objectFitData = [
|
|
38
|
-
{ name: "contain-horizontal", objectFit: "contain", width: 1200 },
|
|
39
|
-
{ name: "contain-vertical", objectFit: "contain", width: 400 },
|
|
40
|
-
{ name: "fill", objectFit: "fill", width: 1200 },
|
|
41
|
-
{ name: "cover-horizontal", objectFit: "cover", width: 1200 },
|
|
42
|
-
{ name: "cover-vertical", objectFit: "cover", width: 400 },
|
|
43
|
-
];
|
|
44
|
-
this.objectFitIndex = 0;
|
|
45
|
-
|
|
46
|
-
this.buttonRowCount = 7;
|
|
47
|
-
this.focusedItemIndex = 0;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
created() {
|
|
51
|
-
this.setPlaybackRate(0);
|
|
52
|
-
this.setObjectFit(0);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
setup() {
|
|
56
|
-
return {
|
|
57
|
-
focusHub: useFocusHub()
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
onKeyDown(ev) {
|
|
62
|
-
// 8:Backspace, 27:Escape, 10000:盒子返回键
|
|
63
|
-
if(ev.keyCode == 8 || ev.keyCode == 27 || ev.keyCode == 10000) {
|
|
64
|
-
this.$router?.go(-1); // 有router时,回退
|
|
65
|
-
return true;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
let focusStep = 0;
|
|
69
|
-
let autoFindNext = false;
|
|
70
|
-
switch (ev.keyCode) {
|
|
71
|
-
case 37: // Left
|
|
72
|
-
focusStep = -1;
|
|
73
|
-
autoFindNext = true;
|
|
74
|
-
break;
|
|
75
|
-
case 39: // Right
|
|
76
|
-
focusStep = 1;
|
|
77
|
-
autoFindNext = true;
|
|
78
|
-
break;
|
|
79
|
-
case 38: // Up
|
|
80
|
-
focusStep = -this.buttonRowCount;
|
|
81
|
-
break;
|
|
82
|
-
case 40: // Down
|
|
83
|
-
focusStep = this.buttonRowCount;
|
|
84
|
-
break;
|
|
85
|
-
default:
|
|
86
|
-
break;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
const buttonData = this.getButtonData();
|
|
90
|
-
const buttonAllCount = this.buttonRowCount * 2;
|
|
91
|
-
let newFocusIdx = this.focusedItemIndex;
|
|
92
|
-
let hasNextFocusItem = false;
|
|
93
|
-
while(true) {
|
|
94
|
-
newFocusIdx = (newFocusIdx + focusStep + buttonAllCount) % buttonAllCount;
|
|
95
|
-
if(!buttonData[newFocusIdx]?.name) {
|
|
96
|
-
if(autoFindNext) {
|
|
97
|
-
continue;
|
|
98
|
-
} else {
|
|
99
|
-
break;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
hasNextFocusItem = true;
|
|
104
|
-
break;
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
if(hasNextFocusItem) {
|
|
108
|
-
this.focusHub.setFocus('controllor.' + 'btn-' + newFocusIdx);
|
|
109
|
-
this.focusedItemIndex = newFocusIdx;
|
|
110
|
-
return true;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
return false;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
getButtonList() {
|
|
117
|
-
const buttonList = [{
|
|
118
|
-
name: "To AudioMode",
|
|
119
|
-
onClick: () => {
|
|
120
|
-
this.mediaCtrl.type = (this.mediaCtrl.type == 'audio' ? 'video' : 'audio');
|
|
121
|
-
this.mediaCtrl.autoplay = true; // 自动播放
|
|
122
|
-
this.mediaCtrl.mute = false; // 关闭静音
|
|
123
|
-
this.mediaCtrl.loop = false; // 关闭循环
|
|
124
|
-
this.mediaTime.currentTime = 0;
|
|
125
|
-
this.mediaTime.duration = 0;
|
|
126
|
-
this.mediaCtrl.playTrigger = 0; // 停止并初始化播放
|
|
127
|
-
this.setPlaybackRate(0);
|
|
128
|
-
this.setObjectFit(0);
|
|
129
|
-
this.videoCtrl.visibility = 'visible';
|
|
130
|
-
if(this.mediaCtrl.type == 'audio') {
|
|
131
|
-
this.mediaStatus.objectFit = '';
|
|
132
|
-
this.videoCtrl.visibility = '';
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
this.focusedItemIndex = 0;
|
|
136
|
-
},
|
|
137
|
-
isModeButton: true,
|
|
138
|
-
}, {
|
|
139
|
-
name: "Play",
|
|
140
|
-
onClick: () => {
|
|
141
|
-
this.mediaCtrl.playTrigger = ++this.mediaCtrl.playTrigger; /* 为了触发ref更新 */
|
|
142
|
-
},
|
|
143
|
-
isPlayButton: true,
|
|
144
|
-
}, {
|
|
145
|
-
name: "Rewind <<",
|
|
146
|
-
onClick: () => {
|
|
147
|
-
this.mediaCtrl.seek = (this.mediaCtrl.seek !== -10 ? -10 : -10.1/* 为了触发ref更新 */);
|
|
148
|
-
}
|
|
149
|
-
}, {
|
|
150
|
-
name: "Forward >>",
|
|
151
|
-
onClick: () => {
|
|
152
|
-
this.mediaCtrl.seek = (this.mediaCtrl.seek !== +10 ? +10 : +10.1/* 为了触发ref更新 */);
|
|
153
|
-
}
|
|
154
|
-
}, {
|
|
155
|
-
name: "Reload",
|
|
156
|
-
onClick: () => {
|
|
157
|
-
this.mediaCtrl.loadTrigger = ++this.mediaCtrl.loadTrigger; /* 为了触发ref更新 */
|
|
158
|
-
},
|
|
159
|
-
}, {
|
|
160
|
-
name: "Loop Off",
|
|
161
|
-
onClick: () => {
|
|
162
|
-
this.mediaCtrl.loop = !this.mediaCtrl.loop;
|
|
163
|
-
},
|
|
164
|
-
isLoopButton: true,
|
|
165
|
-
}, {
|
|
166
|
-
name: "ObjectFit",
|
|
167
|
-
onClick: this.setObjectFit.bind(this)
|
|
168
|
-
}, {
|
|
169
|
-
// 空,按钮对其用
|
|
170
|
-
}, {
|
|
171
|
-
name: "Mute Off",
|
|
172
|
-
onClick: () => {
|
|
173
|
-
this.mediaCtrl.mute = !this.mediaCtrl.mute;
|
|
174
|
-
},
|
|
175
|
-
isMuteButton: true,
|
|
176
|
-
}, {
|
|
177
|
-
name: "Volume",
|
|
178
|
-
onClick: () => {
|
|
179
|
-
this.mediaCtrl.volume = (this.mediaCtrl.volume !== 0.2 ? 0.2 : 0.21/* 为了触发ref更新 */);
|
|
180
|
-
}
|
|
181
|
-
}, {
|
|
182
|
-
name: "Rate",
|
|
183
|
-
onClick: this.setPlaybackRate.bind(this)
|
|
184
|
-
}, {
|
|
185
|
-
name: "Visibility",
|
|
186
|
-
onClick: () => {
|
|
187
|
-
this.videoCtrl.visibility = (this.videoCtrl.visibility != 'visible' ? 'visible' : 'hidden');
|
|
188
|
-
},
|
|
189
|
-
},
|
|
190
|
-
];
|
|
191
|
-
|
|
192
|
-
return buttonList;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
getButtonData() {
|
|
196
|
-
const buttonWidth = 158;
|
|
197
|
-
const buttonHeight = 40;
|
|
198
|
-
const buttonSpacing = 15;
|
|
199
|
-
|
|
200
|
-
let data = [];
|
|
201
|
-
const length = this.buttonList.length;
|
|
202
|
-
for(let idx = 0; idx < length; idx++) {
|
|
203
|
-
let button = this.buttonList[idx];
|
|
204
|
-
if(this.mediaCtrl.type == 'audio'
|
|
205
|
-
&& (button.name == 'ObjectFit'
|
|
206
|
-
|| button.name == 'Visibility')) { // 只有video方式可以做ObjectFit和visibility
|
|
207
|
-
button = {};
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
data.push({
|
|
211
|
-
...button,
|
|
212
|
-
layout: {
|
|
213
|
-
left: (buttonWidth + buttonSpacing) * (idx % this.buttonRowCount),
|
|
214
|
-
top: (buttonHeight + buttonSpacing) * Math.floor(idx / this.buttonRowCount),
|
|
215
|
-
width: buttonWidth,
|
|
216
|
-
height: buttonHeight,
|
|
217
|
-
}
|
|
218
|
-
});
|
|
219
|
-
}
|
|
220
|
-
return data;
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
setPlaybackRate(index) {
|
|
224
|
-
if(typeof index === 'number') {
|
|
225
|
-
this.playbackRateIndex = index;
|
|
226
|
-
} else {
|
|
227
|
-
this.playbackRateIndex = (++this.playbackRateIndex % this.playbackRateData.length);
|
|
228
|
-
}
|
|
229
|
-
const data = this.playbackRateData[this.playbackRateIndex];
|
|
230
|
-
this.mediaStatus.playbackRate = data.name;
|
|
231
|
-
this.mediaCtrl.playbackRate = data.playbackRate;
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
setObjectFit(index) {
|
|
235
|
-
if(typeof index === 'number') {
|
|
236
|
-
this.objectFitIndex = index;
|
|
237
|
-
} else {
|
|
238
|
-
this.objectFitIndex = (++this.objectFitIndex % this.objectFitData.length);
|
|
239
|
-
}
|
|
240
|
-
const data = this.objectFitData[this.objectFitIndex];
|
|
241
|
-
this.mediaStatus.objectFit = data.name;
|
|
242
|
-
this.videoCtrl.objectFit = data.objectFit;
|
|
243
|
-
this.videoCtrl.layout = {
|
|
244
|
-
left: (1280 - data.width) / 2, top: 20,
|
|
245
|
-
width: data.width, height: 500,
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
getShowName(item) {
|
|
250
|
-
if(item.isModeButton) {
|
|
251
|
-
return this.mediaCtrl.type == 'audio' ? "To VideoMode" : "To AudioMode";
|
|
252
|
-
} else if(item.isPlayButton) {
|
|
253
|
-
return this.mediaStatus.playing ? 'Pause' : 'Play'
|
|
254
|
-
} else if(item.isLoopButton) {
|
|
255
|
-
return this.mediaCtrl.loop ? 'Loop Off' : 'Loop On'
|
|
256
|
-
} else if(item.isMuteButton) {
|
|
257
|
-
return this.mediaCtrl.mute ? 'Mute Off' : 'Mute On'
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
return item.name;
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
export default Controllor;
|
|
265
|
-
</script>
|
|
266
|
-
|
|
267
|
-
<template>
|
|
268
|
-
<div :style="style" :key="mediaCtrl.type + mediaCtrl.loop + mediaCtrl.mute + mediaStatus.playing">
|
|
269
|
-
<jsv-focus-block namespace="controllor" :onKeyDown="onKeyDown">
|
|
270
|
-
<div v-for="(item,index) in getButtonData()" :key="index">
|
|
271
|
-
<Button v-if="item.name"
|
|
272
|
-
:style="{ left: item.layout.left, top: item.layout.top,
|
|
273
|
-
width:item.layout.width, height:item.layout.height }"
|
|
274
|
-
:autoFocus="index === focusedItemIndex"
|
|
275
|
-
:name="'btn-' + index"
|
|
276
|
-
:onClick="item.onClick"
|
|
277
|
-
>
|
|
278
|
-
{{ getShowName(item) }}
|
|
279
|
-
</Button>
|
|
280
|
-
</div>
|
|
281
|
-
</jsv-focus-block>
|
|
282
|
-
</div>
|
|
283
|
-
</template>
|
|
284
|
-
|
|
285
|
-
<style scoped>
|
|
286
|
-
</style>
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import { inject } from 'vue'
|
|
3
|
-
import { Options, Vue } from "vue-class-component";
|
|
4
|
-
|
|
5
|
-
@Options({
|
|
6
|
-
})
|
|
7
|
-
class StatusBar extends Vue {
|
|
8
|
-
constructor(props) {
|
|
9
|
-
super(props);
|
|
10
|
-
|
|
11
|
-
this.mediaCtrl = inject('mediaCtrl');
|
|
12
|
-
this.mediaTime = inject('mediaTime');
|
|
13
|
-
this.mediaStatus = inject('mediaStatus');
|
|
14
|
-
this.videoCtrl = inject('videoCtrl');
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export default StatusBar;
|
|
19
|
-
</script>
|
|
20
|
-
|
|
21
|
-
<template>
|
|
22
|
-
<div>
|
|
23
|
-
<div class="text progress">
|
|
24
|
-
{{ 'progress:' + Math.ceil(mediaTime.currentTime) + '/' + Math.ceil(mediaTime.duration) }}
|
|
25
|
-
</div>
|
|
26
|
-
<div class="text mute">
|
|
27
|
-
{{ mediaCtrl.mute ? 'muted' : '-' }}
|
|
28
|
-
</div>
|
|
29
|
-
<div class="text volume">
|
|
30
|
-
{{ 'volume:' + mediaStatus.volume }}
|
|
31
|
-
</div>
|
|
32
|
-
<div class="text rate">
|
|
33
|
-
{{ mediaStatus.playbackRate }}
|
|
34
|
-
</div>
|
|
35
|
-
<div class="text visibility" :key="videoCtrl.visibility">
|
|
36
|
-
{{ videoCtrl.visibility }}
|
|
37
|
-
</div>
|
|
38
|
-
<div class="text loop">
|
|
39
|
-
{{ mediaCtrl.loop ? 'looping' : '-' }}
|
|
40
|
-
</div>
|
|
41
|
-
<div class="text objectFit" :key="mediaStatus.objectFit">
|
|
42
|
-
{{ mediaStatus.objectFit }}
|
|
43
|
-
</div>
|
|
44
|
-
<div class="text status">
|
|
45
|
-
{{ 'status: ' + mediaStatus.playState }}
|
|
46
|
-
</div>
|
|
47
|
-
</div>
|
|
48
|
-
</template>
|
|
49
|
-
|
|
50
|
-
<style scoped>
|
|
51
|
-
.text {
|
|
52
|
-
color: #FF0000;
|
|
53
|
-
font-size: 24;
|
|
54
|
-
width: 158;
|
|
55
|
-
height: 40;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.progress {
|
|
59
|
-
left: 0;
|
|
60
|
-
width: 300;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.mute {
|
|
64
|
-
left: 173; /* (158+15)*1 */
|
|
65
|
-
text-align: center;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
.volume {
|
|
69
|
-
left: 346; /* (158+15)*2 */
|
|
70
|
-
text-align: center;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
.rate {
|
|
74
|
-
left: 519; /* (158+15)*3 */
|
|
75
|
-
text-align: center;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
.visibility {
|
|
79
|
-
left: 692; /* (158+15)*4 */
|
|
80
|
-
text-align: center;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
.loop {
|
|
84
|
-
left: 865; /* (158+15)*5 */
|
|
85
|
-
text-align: center;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
.objectFit {
|
|
89
|
-
left: 1020; /* (158+15)*6-x */
|
|
90
|
-
width: 190;
|
|
91
|
-
text-align: center;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
.status {
|
|
95
|
-
left: 0;
|
|
96
|
-
top: 30;
|
|
97
|
-
width: 800;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
</style>
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import { inject, watch } from 'vue'
|
|
3
|
-
import { Options, Vue } from "vue-class-component";
|
|
4
|
-
import AudioPoster from "./AudioPoster";
|
|
5
|
-
import MediaFrame from "./MediaFrame";
|
|
6
|
-
|
|
7
|
-
@Options({
|
|
8
|
-
components: {
|
|
9
|
-
AudioPoster,
|
|
10
|
-
MediaFrame,
|
|
11
|
-
},
|
|
12
|
-
})
|
|
13
|
-
class AudioFrame extends Vue {
|
|
14
|
-
constructor(props) {
|
|
15
|
-
super(props);
|
|
16
|
-
|
|
17
|
-
this.mediaStatus = inject('mediaStatus');
|
|
18
|
-
|
|
19
|
-
this.audioUrl = "https://cdn.release.qcast.cn/JsViewFrameworkTester/JsViewVueSampleResources/MediaDemo/components/frames/AudioFrame/demo_test.mp3";
|
|
20
|
-
// is.audioUrl = "http://192.168.1.99/videos/empty.mp3";
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export default AudioFrame;
|
|
25
|
-
</script>
|
|
26
|
-
|
|
27
|
-
<template>
|
|
28
|
-
<MediaFrame
|
|
29
|
-
tagName="audio"
|
|
30
|
-
:src="audioUrl"
|
|
31
|
-
/>
|
|
32
|
-
|
|
33
|
-
<AudioPoster
|
|
34
|
-
:playing="this.mediaStatus.playing"
|
|
35
|
-
/>
|
|
36
|
-
</template>
|
|
37
|
-
|
|
38
|
-
<style scoped>
|
|
39
|
-
</style>
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import { inject, watch } from 'vue'
|
|
3
|
-
import { Options, Vue } from "vue-class-component";
|
|
4
|
-
import posterImgPath from '../../assets/audio-poster.png';
|
|
5
|
-
|
|
6
|
-
@Options({
|
|
7
|
-
props: {
|
|
8
|
-
playing: Boolean
|
|
9
|
-
}
|
|
10
|
-
})
|
|
11
|
-
class AudioPoster extends Vue {
|
|
12
|
-
constructor(props) {
|
|
13
|
-
super(props);
|
|
14
|
-
|
|
15
|
-
this.posterImgPath = posterImgPath;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
onPlayPauseChanged(play) {
|
|
19
|
-
console.warn('onPlayPauseChanged() ' + play);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export default AudioPoster;
|
|
24
|
-
</script>
|
|
25
|
-
|
|
26
|
-
<template>
|
|
27
|
-
<div
|
|
28
|
-
:style="{
|
|
29
|
-
left: 380,
|
|
30
|
-
top: 10,
|
|
31
|
-
width: 512,
|
|
32
|
-
height: 512,
|
|
33
|
-
backgroundImage: posterImgPath,
|
|
34
|
-
animation: (playing ? 'PosterRotate 6s infinite linear' : null),
|
|
35
|
-
}"
|
|
36
|
-
/>
|
|
37
|
-
</template>
|
|
38
|
-
|
|
39
|
-
<style scoped>
|
|
40
|
-
@keyframes PosterRotate {
|
|
41
|
-
from {
|
|
42
|
-
transform: rotate3d(0, 0, 1, 0deg);
|
|
43
|
-
}
|
|
44
|
-
to {
|
|
45
|
-
transform: rotate3d(0, 0, 1, 360deg);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
</style>
|
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import { inject, watch } from 'vue'
|
|
3
|
-
import { Options, Vue } from "vue-class-component";
|
|
4
|
-
|
|
5
|
-
@Options({
|
|
6
|
-
props: {
|
|
7
|
-
tagName: String,
|
|
8
|
-
src: String,
|
|
9
|
-
style: { type:Object, default: {}},
|
|
10
|
-
},
|
|
11
|
-
})
|
|
12
|
-
class MediaFrame extends Vue {
|
|
13
|
-
constructor(props) {
|
|
14
|
-
super(props);
|
|
15
|
-
|
|
16
|
-
this.mediaRef = null;
|
|
17
|
-
|
|
18
|
-
this.mediaCtrl = inject('mediaCtrl');
|
|
19
|
-
this.mediaTime = inject('mediaTime');
|
|
20
|
-
this.mediaStatus = inject('mediaStatus');
|
|
21
|
-
|
|
22
|
-
watch(() => this.mediaCtrl.seek, this.seekMediaStep.bind(this));
|
|
23
|
-
watch(() => this.mediaCtrl.volume, this.volumeMediaStep.bind(this));
|
|
24
|
-
watch(() => this.mediaCtrl.playTrigger, this.setPlayPause.bind(this));
|
|
25
|
-
watch(() => this.mediaCtrl.loadTrigger, this.reload.bind(this));
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
mounted() {
|
|
29
|
-
this.mediaRef = this.$refs.mediaRef;
|
|
30
|
-
this.mediaStatus.volume = this.mediaRef.volume;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
seekMediaStep(timeStep) {
|
|
34
|
-
if(!this.mediaRef) {
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
let playEnd = false;
|
|
39
|
-
let seekTime = this.mediaRef.currentTime + Math.ceil(timeStep);
|
|
40
|
-
if(seekTime < 0) {
|
|
41
|
-
seekTime = 0;
|
|
42
|
-
} else if(seekTime > this.mediaTime.duration) {
|
|
43
|
-
seekTime = this.mediaTime.duration;
|
|
44
|
-
if(this.mediaRef.currentTime != this.mediaTime.duration) { // 触发一次播放,收到ended事件
|
|
45
|
-
playEnd = true;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
this.mediaRef.currentTime = seekTime;
|
|
49
|
-
if(playEnd) {
|
|
50
|
-
this.setPlayPause(true);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
setPlayPause() {
|
|
55
|
-
if(!this.mediaStatus.playing) {
|
|
56
|
-
this.mediaRef.play();
|
|
57
|
-
} else {
|
|
58
|
-
this.mediaRef.pause();
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
reload() {
|
|
63
|
-
this.mediaRef.load();
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
volumeMediaStep(volumeStep) {
|
|
67
|
-
if(!this.mediaRef) {
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
let volume = this.mediaRef.volume + volumeStep;
|
|
72
|
-
if(volume < 0) {
|
|
73
|
-
volume += 1;
|
|
74
|
-
}else if(volume > 1) {
|
|
75
|
-
volume -= 1;
|
|
76
|
-
}
|
|
77
|
-
volume = Math.round(volume * 10) / 10; // 保留一位小数
|
|
78
|
-
this.mediaRef.volume = volume;
|
|
79
|
-
this.mediaStatus.volume = volume;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
onErrorEvent(event) {
|
|
83
|
-
const state = event.type + ": code=" + this.mediaRef.error.code + ", message=" + this.mediaRef.error.message;
|
|
84
|
-
console.log("MediaFrame.onErrorEvent()", event, state);
|
|
85
|
-
this.mediaStatus.playState = state;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
onTimeUpdate(event) {
|
|
89
|
-
if(!this.mediaRef) { // unmounted
|
|
90
|
-
return;
|
|
91
|
-
}
|
|
92
|
-
// console.log("MediaFrame.onTimeUpdate()", event, this.mediaRef.currentTime);
|
|
93
|
-
this.mediaTime.currentTime = this.mediaRef.currentTime;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
onDurationChange(event) {
|
|
97
|
-
console.log("MediaFrame.onDurationChange()", event.type);
|
|
98
|
-
this.mediaTime.duration = this.mediaRef.duration;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
onOtherEvent(event) {
|
|
102
|
-
console.log("MediaFrame.onOtherEvent()", event.type);
|
|
103
|
-
this.mediaStatus.playState = event.type;
|
|
104
|
-
if(event.type == 'playing') {
|
|
105
|
-
this.mediaStatus.playing = true;
|
|
106
|
-
} else if(event.type == 'loadstart'
|
|
107
|
-
|| event.type == 'pause'
|
|
108
|
-
|| event.type == 'error') {
|
|
109
|
-
this.mediaStatus.playing = false;
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
export default MediaFrame;
|
|
115
|
-
</script>
|
|
116
|
-
|
|
117
|
-
<template>
|
|
118
|
-
<div>
|
|
119
|
-
<!-- <component :is="tagName"> 可以直接换成<video>/<audio>, -->
|
|
120
|
-
<!-- 这里是为了统一onEvent处理才这样写 -->
|
|
121
|
-
<component :is="tagName"
|
|
122
|
-
ref="mediaRef"
|
|
123
|
-
|
|
124
|
-
:style="style"
|
|
125
|
-
|
|
126
|
-
:autoplay="mediaCtrl.autoplay"
|
|
127
|
-
:loop="mediaCtrl.loop"
|
|
128
|
-
:muted="mediaCtrl.mute"
|
|
129
|
-
:playbackRate="mediaCtrl.playbackRate"
|
|
130
|
-
:src="src"
|
|
131
|
-
|
|
132
|
-
:onabort="onOtherEvent"
|
|
133
|
-
:oncanplay="onOtherEvent"
|
|
134
|
-
:oncanplaythrough="onOtherEvent"
|
|
135
|
-
:ondurationchange="onDurationChange"
|
|
136
|
-
:onended="onOtherEvent"
|
|
137
|
-
:onerror="onErrorEvent"
|
|
138
|
-
:onload="onOtherEvent"
|
|
139
|
-
:onloadedmetadata="onOtherEvent"
|
|
140
|
-
:onloadstart="onOtherEvent"
|
|
141
|
-
:onpause="onOtherEvent"
|
|
142
|
-
:onplay="onOtherEvent"
|
|
143
|
-
:onplaying="onOtherEvent"
|
|
144
|
-
:onseeking="onOtherEvent"
|
|
145
|
-
:onseeked="onOtherEvent"
|
|
146
|
-
:onstalled="onOtherEvent"
|
|
147
|
-
:ontimeupdate="onTimeUpdate"
|
|
148
|
-
/>
|
|
149
|
-
</div>
|
|
150
|
-
</template>
|
|
151
|
-
|
|
152
|
-
<style scoped>
|
|
153
|
-
</style>
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import { inject } from 'vue'
|
|
3
|
-
import { Options, Vue } from "vue-class-component";
|
|
4
|
-
import MediaFrame from "./MediaFrame";
|
|
5
|
-
|
|
6
|
-
@Options({
|
|
7
|
-
components: {
|
|
8
|
-
MediaFrame,
|
|
9
|
-
},
|
|
10
|
-
})
|
|
11
|
-
class VideoFrame extends Vue {
|
|
12
|
-
constructor(props) {
|
|
13
|
-
super(props);
|
|
14
|
-
|
|
15
|
-
this.videoCtrl = inject('videoCtrl');
|
|
16
|
-
|
|
17
|
-
this.videoUrl = "https://cdn.release.qcast.cn/JsViewFrameworkTester/JsViewVueSampleResources/MediaDemo/components/frames/VideoFrame/neza.mp4";
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export default VideoFrame;
|
|
22
|
-
</script>
|
|
23
|
-
|
|
24
|
-
<template>
|
|
25
|
-
<MediaFrame
|
|
26
|
-
tagName="video"
|
|
27
|
-
:src="videoUrl"
|
|
28
|
-
|
|
29
|
-
:style="{
|
|
30
|
-
...videoCtrl.layout,
|
|
31
|
-
visibility: videoCtrl.visibility,
|
|
32
|
-
objectFit: videoCtrl.objectFit,
|
|
33
|
-
borderRadius: '80 80 160 240',
|
|
34
|
-
}"
|
|
35
|
-
/>
|
|
36
|
-
</template>
|
|
37
|
-
|
|
38
|
-
<style scoped>
|
|
39
|
-
</style>
|