Jump to content
Tuts 4 You

How to play video from URL? (MASM)


Recommended Posts

Posted

Replying to this comment: https://forum.tuts4you.com/topic/45087-mediaplayer/?do=findComment&comment=222146, here as it is better to use this topic for discussions relating to the MFPlayer library and coding relating to it than the MediaPlayer topic itself.

Once a media item has been created, you can then set it in the queue with the MFPMediaPlayer_SetMediaItem function: https://mfplayer-library.readthedocs.io/en/latest/MFPlayer Functions/MFPMediaPlayer Functions/MFPMediaPlayer_SetMediaItem.html#mfpmediaplayer-setmediaitem

Once its in the queue you can use the MFMediaPlayer_Play function to start playback.

Ideally you would not create the media item, queue it and play all from one "play" button, as each time you hit play you are going to be creating a new pMediaItem object, without releasing the previous one. I would recommend to load the media file with the CreateMediaItemA/W function, then set it in the queue. When user clicks play button, it just uses the MFMediaPlayer_Play function.

In my event handler, when the media item is queued/set (using MFPMediaPlayer_SetMediaItem), then I call play (think of it as autoplay when loading a new file into the media player example)

If you don't want to use the event notification callback then just pass NULL instead of the address of an event handler.

 

 

 

  • Like 2

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...