Open AlenToma opened 5 years ago
Yes, can you post the url?
The video is a local video.
Here you can retrive it
https://mega.nz/#!loxVQAzI!PPfTuR8xiCJYyTaxm-HPVqAFEX9bDX-oksVDqrZygF8
The name of the file is
#جميلة - #دمدومة | Jamila - #Damdouma[I=exdfhcEjbwY][F=18][P=6].mp4
It may be related to the name, i will check it out.
Was able to resolve the issue by creatng new URI
new Uri("#جميلة - #دمدومة | Jamila - #Damdouma[I=exdfhcEjbwY][F=18][P=6].mp4").AbsoluteUri;
This is where a Resolver
could do its work.
I dont know if this issue should be handled by the library or the user.
I'm not sure if it is possible to use a url resolver right before playing. Would it be useful to add a resolver that works on the beginning, when you add the url to play, or to the queue?
In this case it easy to do it as you said. But there is other cases, when the url need decrypting like i mentioned in MediaItem Resolver
#510
I was thinking of something like this
in IMediaPlayer
have a property.
IMediaItemResolver ItemResolver { get; set; }
The IMediaItemResolver
look like below
/// <summary>
/// Validate & resolve Mediaitem before playing it
/// </summary>
public interface IMediaItemResolver
{
/// <summary>
/// Return null will force the MediaPlayer, to stop playing the item.
/// Validate and Make changes to mediaItem like MediaUrl
/// </summary>
/// <param name="mediaItem"></param>
/// <returns></returns>
IMediaItem Resolve(IMediaItem mediaItem);
/// <summary>
/// When the resolver fail, you could handle it. like playing the next video , or even change to a
/// different MediaPlayer that can handle the MediaItem. for example try to decrypt a youtube URI
/// when it failed then play the item in youtube player instead eg changing the MediaPlayer.
/// </summary>
Action<IMediaManager> OnFailed { get; set; }
}
And then having an extension like below
public static bool ResolveMediaItem(this IMediaPlayer mediaPlayer, IMediaItem mediaItem)
{
IMediaItemResolver itemResolver = null;
#if ANDROID
// this is only temporary as the itemResolver exist only in Android
itemResolver = mediaPlayer.ItemResolver;
#endif
if (itemResolver != null)
{
var resolvedMediaItem = itemResolver.Resolve(mediaItem);
if (resolvedMediaItem == null)
{
itemResolver.OnFailed?.Invoke(CrossMediaManager.Current);
return false; // will prevent setting the source to the mediaplayer
}
if (resolvedMediaItem != mediaItem) /// new created IMediaItem from resolver, try and get all the changes
{
foreach (var p in typeof(IMediaItem).GetType().GetProperties())
{
var value = p.GetValue(resolvedMediaItem);
var currentValue = p.GetValue(mediaItem);
if (value != currentValue && value != null)
{
p.SetValue(mediaItem, value);
}
}
}
}
return true;
}
If this is a very big change then forget, its alright i will find another way :)
🐛 Bug Report
unable to play some videos, as it throw an exception
Expected behavior
The video should play normaly, as its type is an
mp4
Reproduction steps
The video is of type
mp4
, just by playing it, it throw some kind of java exception.Exception detalj
I could post the video if you like.
Configuration
Version: 0.6.8
Platform: