Skip to content

Commit

Permalink
Merge pull request #360 from ywmoyue/dev
Browse files Browse the repository at this point in the history
4.6.17
  • Loading branch information
ywmoyue authored Oct 26, 2023
2 parents e8dc3c3 + a45d859 commit 0ac48ab
Show file tree
Hide file tree
Showing 110 changed files with 5,048 additions and 2,818 deletions.
106 changes: 101 additions & 5 deletions src/BiliLite.UWP/BiliLite.UWP.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Project ToolsVersion="15.0" DefaultTargets="Build"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props"
Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
Expand Down Expand Up @@ -136,12 +138,104 @@
<RestoreProjectStyle>PackageReference</RestoreProjectStyle>
</PropertyGroup>
<ItemGroup>
<Compile Include="Models\Common\Live\LiveMessageHandleActionsMap.cs" />
<Compile Include="Models\Common\Player\DefaultPlayerModeOptions.cs" />
<Compile Include="Models\Common\Player\LivePlayerMode.cs" />
<Compile Include="Models\Common\Player\PlayerConfig.cs" />
<Compile Include="Models\Common\Player\PlayerError.cs" />
<Compile Include="Models\Common\Player\BasePlayUrlInfo.cs" />
<Compile Include="Models\Common\Player\RealPlayInfo.cs" />
<Compile Include="Models\Common\UserDynamic\IUserDynamicContentDisplayInfo.cs" />
<Compile Include="Models\Common\UserDynamic\UserDynamicCtrlItem.cs" />
<Compile Include="Models\Common\UserDynamic\UserDynamicDisplayTypesMap.cs" />
<Compile Include="Models\Common\UserDynamic\UserDynamicParseOneRowInfoActionsMap.cs" />
<Compile Include="Models\Common\UserDynamic\UserDynamicSeasonDisplayInfo.cs" />
<Compile Include="Models\Common\UserDynamic\UserDynamicType.cs" />
<Compile Include="Models\Common\Live\LiveBuvidModel.cs" />
<Compile Include="Models\Common\Live\LiveDanmukuHostModel.cs" />
<Compile Include="Models\Common\Live\LiveDanmukuInfoModel.cs" />
<Compile Include="Models\Common\Live\LiveGuardRankItem.cs" />
<Compile Include="Models\Common\Live\LiveRoomAnchorLotteryInfoModel.cs" />
<Compile Include="Models\Common\Live\LiveRoomEndAnchorLotteryInfoModel.cs" />
<Compile Include="Models\Common\Live\LiveRoomEndAnchorLotteryInfoUserModel.cs" />
<Compile Include="Models\Common\Live\LiveRoomRankItemModel.cs" />
<Compile Include="Models\Common\Live\LiveRoomSuperChatModel.cs" />
<Compile Include="Models\Common\Live\LiveRoomSuperChatUserInfoModel.cs" />
<Compile Include="Models\Common\Live\LiveAnchorProfile.cs" />
<Compile Include="Models\Common\Live\LiveAnchorInfoBaseInfoModel.cs" />
<Compile Include="Models\Common\Live\LiveAnchorInfoLiveInfoModel.cs" />
<Compile Include="Models\Common\Live\LiveAnchorInfoModel.cs" />
<Compile Include="Models\Common\Live\LiveAnchorInfoOfficialInfoModel.cs" />
<Compile Include="Models\Common\Live\LiveAnchorInfoRelationInfoModel.cs" />
<Compile Include="Models\Common\Live\LiveAnchorProfileGloryInfo.cs" />
<Compile Include="Models\Common\Live\LiveAnchorProfilePkInfo.cs" />
<Compile Include="Models\Common\Live\LiveBagGiftItem.cs" />
<Compile Include="Models\Common\Live\LiveGiftItem.cs" />
<Compile Include="Models\Common\Live\LiveGiftItemCountMap.cs" />
<Compile Include="Models\Common\Live\LiveInfoModel.cs" />
<Compile Include="Models\Common\Live\DanmuMsgModel.cs" />
<Compile Include="Models\Common\Live\GiftMsgModel.cs" />
<Compile Include="Models\Common\Live\GuardBuyMsgModel.cs" />
<Compile Include="Models\Common\Live\RoomChangeMsgModel.cs" />
<Compile Include="Models\Exceptions\PlayerException.cs" />
<Compile Include="Player\Controllers\BasePlayerController.cs" />
<Compile Include="Player\Controllers\LivePlayerController.cs" />
<Compile Include="Player\Controllers\PlayerControllerFactory.cs" />
<Compile Include="Player\Controllers\PlayerType.cs" />
<Compile Include="Player\IBiliPlayer2.cs" />
<Compile Include="Player\LivePlayer.cs" />
<Compile Include="Player\States\BaseStateChangedEventArgs.cs" />
<Compile Include="Player\States\ContentStates\ContentStateChangedEventArgs.cs" />
<Compile Include="Player\States\ContentStates\FullWindowContentState.cs" />
<Compile Include="Player\States\ContentStates\ContentStateHandler.cs" />
<Compile Include="Player\States\ContentStates\IContentState.cs" />
<Compile Include="Player\States\ContentStates\NormalWindowContentState.cs" />
<Compile Include="Player\States\PauseStates\PausedState.cs" />
<Compile Include="Player\States\PauseStates\PauseStateChangedEventArgs.cs" />
<Compile Include="Player\States\PauseStates\PauseStateHandler.cs" />
<Compile Include="Player\States\PauseStates\ResumeState.cs" />
<Compile Include="Player\States\PlayStates\BufferingPlayState.cs" />
<Compile Include="Player\States\PlayStates\PlayStateChangedEventArgs.cs" />
<Compile Include="Player\States\ScreenStates\ScreenStateChangedEventArgs.cs" />
<Compile Include="Player\States\ScreenStates\ScreenStateHandler.cs" />
<Compile Include="Player\States\ScreenStates\FullscreenState.cs" />
<Compile Include="Player\States\ScreenStates\IScreenState.cs" />
<Compile Include="Player\States\ScreenStates\NormalScreenState.cs" />
<Compile Include="Player\SubPlayers\ISubPlayer.cs" />
<Compile Include="Player\SubPlayers\LiveHlsPlayer.cs" />
<Compile Include="Player\States\PauseStates\IPauseState.cs" />
<Compile Include="Player\States\PlayStates\FaultPlayState.cs" />
<Compile Include="Player\States\PlayStates\LoadingPlayState.cs" />
<Compile Include="Player\States\PlayStates\IdlePlayState.cs" />
<Compile Include="Player\States\PlayStates\IPlayState.cs" />
<Compile Include="Player\States\PlayStates\PlayingPlayState.cs" />
<Compile Include="Player\States\PlayStates\PlayStateHandler.cs" />
<Compile Include="Player\States\PlayStates\StopPlayState.cs" />
<Compile Include="ViewModels\Live\LiveDetailPageViewModel.cs" />
<Compile Include="ViewModels\Live\SuperChatMsgViewModel.cs" />
<Compile Include="Models\Common\Live\WelcomeMsgModel.cs" />
<Compile Include="Models\Common\User\HistoryCursor.cs" />
<Compile Include="Models\Common\User\UserHistory.cs" />
<Compile Include="Models\Common\User\UserHistoryItem.cs" />
<Compile Include="Models\Common\User\UserHistoryItemHistory.cs" />
<Compile Include="ViewModels\Live\LiveRoomAnchorLotteryViewModel.cs" />
<Compile Include="Models\Common\Live\LiveRoomGiftItem.cs" />
<Compile Include="Models\Common\Live\LiveRoomGuardInfoModel.cs" />
<Compile Include="Models\Common\Live\LiveRoomInfoModel.cs" />
<Compile Include="Models\Common\Live\LiveRoomInfoPendantsFrameModel.cs" />
<Compile Include="Models\Common\Live\LiveRoomInfoPendantsModel.cs" />
<Compile Include="Models\Common\Live\LiveRoomPlayUrlModel.cs" />
<Compile Include="ViewModels\Live\LiveRoomRankViewModel.cs" />
<Compile Include="Models\Common\Live\LiveRoomRealPlayUrlsModel.cs" />
<Compile Include="Models\Common\Live\LiveRoomWebUrlCodecItemModel.cs" />
<Compile Include="Models\Common\Live\LiveRoomWebUrlFormatItemModel.cs" />
<Compile Include="Models\Common\Live\LiveRoomWebUrlPlayurlInfoItemModel.cs" />
<Compile Include="Models\Common\Live\LiveRoomWebUrlPlayurlItemModel.cs" />
<Compile Include="Models\Common\Live\LiveRoomWebUrlQualityDescriptionItemModel.cs" />
<Compile Include="Models\Common\Live\LiveRoomWebUrlStreamItemModel.cs" />
<Compile Include="Models\Common\Live\LiveRoomWebUrlUrlinfoItemModel.cs" />
<Compile Include="Models\Common\Live\LiveTitleModel.cs" />
<Compile Include="Models\Common\Live\LiveWalletInfo.cs" />
<Compile Include="ViewModels\UserDynamic\UserDynamicItemDisplayViewModel.cs" />
<Compile Include="Models\Common\UserDynamic\UserDynamicItemDisplayOneRowInfo.cs" />
<Compile Include="Models\Common\UserDynamic\UserDynamicItemDisplayImageInfo.cs" />
Expand Down Expand Up @@ -483,7 +577,7 @@
<Compile Include="Modules\Home\HomeVM.cs" />
<Compile Include="Modules\Home\HotVM.cs" />
<Compile Include="Modules\IModules.cs" />
<Compile Include="Modules\Detail\LiveRoomVM.cs" />
<Compile Include="ViewModels\Live\LiveRoomViewModel.cs" />
<Compile Include="Modules\Home\LiveVM.cs" />
<Compile Include="ViewModels\UserDynamic\UserDynamicRepostViewModel.cs" />
<Compile Include="ViewModels\UserDynamic\UserDynamicViewModel.cs" />
Expand Down Expand Up @@ -1158,10 +1252,12 @@
<Name>Windows Desktop Extensions for the UWP</Name>
</SDKReference>
</ItemGroup>
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '14.0' ">
<PropertyGroup
Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '14.0' ">
<VisualStudioVersion>14.0</VisualStudioVersion>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
<Import
Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
Expand Down
2 changes: 1 addition & 1 deletion src/BiliLite.UWP/Controls/PlayerControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@
</StackPanel>
</Grid>
<ItemsControl x:Name="InteractionChoices"
ItemsSource="{Binding Path=Info.edges.questions,Mode=OneWay}"
ItemsSource="{x:Bind interactionVideoVM.Info.edges.questions}"
Visibility="Collapsed" VerticalAlignment="Bottom" Margin="0 0 0 80">
<ItemsControl.ItemTemplate>
<DataTemplate x:DataType="player:InteractionEdgeInfoQuestionModel">
Expand Down
8 changes: 2 additions & 6 deletions src/BiliLite.UWP/Controls/PlayerControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1635,7 +1635,7 @@ private async Task<bool> ChangeQualityGetPlayUrls(BiliPlayUrlInfo quality, BiliD

private async Task<PlayerOpenResult> ChangeQualityPlayVideo(BiliPlayUrlInfo quality, BiliDashAudioPlayUrlInfo audioQuality)
{
PlayerOpenResult result = new PlayerOpenResult()
var result = new PlayerOpenResult()
{
result = false
};
Expand Down Expand Up @@ -1669,11 +1669,7 @@ private async Task<PlayerOpenResult> ChangeQualityPlayVideo(BiliPlayUrlInfo qual
}
else if (quality.PlayUrlType == BiliPlayUrlType.SingleFLV)
{
result = await Player.PlaySingleFlvUseSYEngine(quality.FlvInfo.First().Url, quality.UserAgent, quality.Referer, positon: _postion, epId: CurrentPlayItem.ep_id);
if (!result.result)
{
result = await Player.PlaySingleFlvUseFFmpegInterop(quality.FlvInfo.First().Url, quality.UserAgent, quality.Referer, positon: _postion);
}
result = await Player.PlaySingleFlvUseFFmpegInterop(quality.FlvInfo.First().Url, quality.UserAgent, quality.Referer, positon: _postion);
}
else if (quality.PlayUrlType == BiliPlayUrlType.MultiFLV)
{
Expand Down
7 changes: 5 additions & 2 deletions src/BiliLite.UWP/Dialogs/DownloadDialog.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ private async void LoadQuality()
m_viewModel.SelectedQualityIndex = 0;

m_viewModel.AudioQualities = data.AudioQualites;
m_viewModel.SelectedAudioQuality = data.AudioQualites.FirstOrDefault();
m_viewModel.SelectedAudioQuality = data.AudioQualites?.FirstOrDefault();
}
private async void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args)
{
Expand Down Expand Up @@ -139,6 +139,9 @@ private async void ContentDialog_PrimaryButtonClick(ContentDialog sender, Conten
});
}
}
var soundQualityId = 0;
if (m_viewModel.SelectedAudioQuality != null)
soundQualityId = m_viewModel.SelectedAudioQuality.QualityID;
//读取视频地址
var playUrl = await playerVM.GetPlayUrls(new PlayInfo()
{
Expand All @@ -149,7 +152,7 @@ private async void ContentDialog_PrimaryButtonClick(ContentDialog sender, Conten
season_id = downloadItem.SeasonID,
season_type = downloadItem.SeasonType,
area = downloadItem.Title.ParseArea(downloadItem.UpMid)
}, qn: (cbQuality.SelectedItem as BiliPlayUrlInfo).QualityID, m_viewModel.SelectedAudioQuality.QualityID);
}, qn: (cbQuality.SelectedItem as BiliPlayUrlInfo).QualityID, soundQualityId);
if (!playUrl.Success)
{
item.State = 99;
Expand Down
2 changes: 2 additions & 0 deletions src/BiliLite.UWP/Extensions/ViewModelExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using BiliLite.ViewModels.Comment;
using BiliLite.ViewModels.Download;
using BiliLite.ViewModels.Home;
using BiliLite.ViewModels.Live;
using BiliLite.ViewModels.User;
using Microsoft.Extensions.DependencyInjection;

Expand All @@ -16,6 +17,7 @@ public static IServiceCollection AddViewModels(this IServiceCollection services)
services.AddTransient<RecommendPageViewModel>();
services.AddTransient<DynamicPageViewModel>();
services.AddTransient<AnimePageViewModel>();
services.AddTransient<LiveDetailPageViewModel>();
return services;
}
}
Expand Down
76 changes: 76 additions & 0 deletions src/BiliLite.UWP/Models/Common/Enumerates.cs
Original file line number Diff line number Diff line change
Expand Up @@ -295,4 +295,80 @@ public enum UserDynamicDisplayType
/// </summary>
Other
}

/// <summary>
/// 消息类型
/// </summary>
public enum MessageType
{
/// <summary>
/// 连接成功
/// </summary>
ConnectSuccess,

/// <summary>
/// 在线人数
/// </summary>
Online,

/// <summary>
/// 弹幕
/// </summary>
Danmu,

/// <summary>
/// 赠送礼物
/// </summary>
Gift,

/// <summary>
/// 欢迎信息
/// </summary>
Welcome,

/// <summary>
/// 系统消息
/// </summary>
SystemMsg,

/// <summary>
/// 醒目留言
/// </summary>
SuperChat,

/// <summary>
/// 醒目留言(日文)
/// </summary>
SuperChatJpn,

/// <summary>
/// 抽奖开始
/// </summary>
AnchorLotteryStart,

/// <summary>
/// 抽奖结束
/// </summary>
AnchorLotteryEnd,

/// <summary>
/// 抽奖结果
/// </summary>
AnchorLotteryAward,

/// <summary>
/// 欢迎舰长
/// </summary>
WelcomeGuard,

/// <summary>
/// 上舰
/// </summary>
GuardBuy,

/// <summary>
/// 房间信息更新
/// </summary>
RoomChange,
}
}
90 changes: 90 additions & 0 deletions src/BiliLite.UWP/Models/Common/Live/DanmuMsgModel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
using System.Linq;
using Windows.UI.Xaml;
using BiliLite.ViewModels.Live;

namespace BiliLite.Models.Common.Live
{
public class DanmuMsgModel
{
/// <summary>
/// 内容文本
/// </summary>
public string Text { get; set; }

/// <summary>
/// 弹幕颜色,默认白色
/// </summary>
public string DanmuColor { get; set; } = "#FFFFFFFF";

/// <summary>
/// 用户名
/// </summary>
public string UserName { get; set; }

/// <summary>
/// 用户名颜色,默认灰色
/// </summary>
public string UserNameColor { get; set; } = "#FF808080";

/// <summary>
/// 等级
/// </summary>
public string UserLevel { get; set; }

/// <summary>
/// 等级颜色,默认灰色
/// </summary>
public string UserLevelColor { get; set; } = "#FF808080";

/// <summary>
/// 用户头衔id(对应的是CSS名)
/// </summary>
public string UserTitleID { get; set; }

/// <summary>
/// 用户头衔图片
/// </summary>
public string UserTitleImage => LiveRoomViewModel.Titles.FirstOrDefault(x => x.Id == UserTitleID)?.Img;

/// <summary>
/// 用户角色
/// </summary>
public string Role { get; set; }

/// <summary>
/// 勋章名称
/// </summary>
public string MedalName { get; set; }

/// <summary>
/// 勋章等级
/// </summary>
public string MedalLevel { get; set; }

/// <summary>
/// 勋章颜色
/// </summary>
public string MedalColor { get; set; }


/// <summary>
/// 是否显示房管
/// </summary>
public Visibility ShowAdmin { get; set; } = Visibility.Collapsed;

/// <summary>
/// 是否显示勋章
/// </summary>
public Visibility ShowMedal { get; set; } = Visibility.Collapsed;

/// <summary>
/// 是否显示用户等级
/// </summary>
public Visibility ShowTitle { get; set; } = Visibility.Collapsed;

/// <summary>
/// 是否显示用户等级
/// </summary>
public Visibility ShowUserLevel { get; set; } = Visibility.Collapsed;
}
}
Loading

0 comments on commit 0ac48ab

Please sign in to comment.